File tree Expand file tree Collapse file tree 2 files changed +70
-0
lines changed Expand file tree Collapse file tree 2 files changed +70
-0
lines changed Original file line number Diff line number Diff line change 1+ on :
2+ push :
3+ tags :
4+ - " *"
5+
6+ env :
7+ REGISTRY : ghcr.io
8+ IMAGE_NAME : ${{ github.repository }}
9+
10+ jobs :
11+ build-and-push-image :
12+ runs-on : ubuntu-latest
13+ permissions :
14+ contents : read
15+ packages : write
16+
17+ steps :
18+ - name : Checkout repository
19+ uses : actions/checkout@v3
20+
21+ - name : Log in to the Container registry
22+ uses : docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
23+ with :
24+ registry : ${{ env.REGISTRY }}
25+ username : ${{ github.actor }}
26+ password : ${{ secrets.GITHUB_TOKEN }}
27+
28+ - name : Extract metadata (tags, labels) for Docker
29+ id : meta
30+ uses : docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
31+ with :
32+ images : ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
33+
34+ - name : Build and push Docker image
35+ uses : docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
36+ with :
37+ context : .
38+ push : true
39+ tags : ${{ steps.meta.outputs.tags }}
40+ labels : ${{ steps.meta.outputs.labels }}
Original file line number Diff line number Diff line change 99WebTeX Render is a simple program used to generate static images from LaTeX equations. It was designed to be used as
1010an alternative to < https://latex.codecogs.com/ > . It also allows you to use arbitrary LaTeX packages in your images.
1111
12+ We also provide a simple web API to generate images on demand.
13+
1214## Usage
1315
1416``` shell
@@ -30,6 +32,19 @@ img.math.inline {
3032}
3133```
3234
35+ ## Using the web API
36+
37+ The ` webtex_web ` requires a configuration file to define "renderers".
38+
39+ ``` yaml
40+ - name : render_name
41+ key : secret
42+ template : template.tex
43+ ` ` `
44+
45+ The TeX image can be then generated at URL ` http://...:8080/render/render_name/?eq=EQUATION&sig=SIGNATURE`.
46+ ` EQUATION` should be a base64 encoded TeX. `SIGNATURE` should be a HMAC-SHA-256 of the `EQUATION` using the key from config.
47+
3348# # Minimal template
3449
3550` ` ` tex
@@ -50,4 +65,19 @@ the document to make sure that all output files are at least `1em` high.
5065
5166` ` ` shell
5267go build -o wr ./webtex_render
68+ go build -o wr_web ./webtex_web
5369` ` `
70+
71+ # # Docker image
72+
73+ We also provide a Docker image. The image contains both `wr` and `wr_web` binaries, but is set up to start the web
74+ API by default.
75+
76+ ` ` ` shell
77+ docker run --rm \
78+ -v ./config.yml:/app/config.yml:ro \
79+ -v ./template.tex:/app/template.tex:ro \
80+ -p 8080:8080 \
81+ ghcr.io/naboj-org/webtex_render
82+ ` ` `
83+
You can’t perform that action at this time.
0 commit comments