https://github.com/winstxnhdw/tectonic-api
A simple axum API for compiling TeX/LaTeX with Tectonic, hosted on Hugging Face Spaces.
https://github.com/winstxnhdw/tectonic-api
axum docker gxhash huggingface-spaces latex moka tectonic
Last synced: about 1 year ago
JSON representation
A simple axum API for compiling TeX/LaTeX with Tectonic, hosted on Hugging Face Spaces.
- Host: GitHub
- URL: https://github.com/winstxnhdw/tectonic-api
- Owner: winstxnhdw
- Created: 2023-06-29T18:48:07.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2025-05-01T11:00:55.000Z (about 1 year ago)
- Last Synced: 2025-05-01T12:19:12.031Z (about 1 year ago)
- Topics: axum, docker, gxhash, huggingface-spaces, latex, moka, tectonic
- Language: Rust
- Homepage: https://huggingface.co/spaces/winstxnhdw/tectonic-api
- Size: 595 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# tectonic-api
[](https://github.com/winstxnhdw/tectonic-api/actions/workflows/main.yml)
[](https://github.com/winstxnhdw/tectonic-api/actions/workflows/build.yml)
[](https://github.com/winstxnhdw/tectonic-api/actions/workflows/warmer.yml)
[](https://github.com/winstxnhdw/tectonic-api/actions/workflows/dependabot.yml)
[](https://huggingface.co/spaces/winstxnhdw/tectonic-api)
[](https://github.com/winstxnhdw/tectonic-api/compare)
A simple [axum](https://github.com/tokio-rs/axum) API for compiling TeX/LaTeX with [Tectonic](https://github.com/tectonic-typesetting/tectonic), hosted on Hugging Face Spaces.
## Usage
Simply cURL the endpoint like in the following.
```bash
curl -O 'https://winstxnhdw-tectonic-api.hf.space/api/v1/compile' \
-H 'Content-Type: application/json' \
-d '{ "latex": "\\\documentclass{article}\\\begin{document}Hello, world!\\\end{document}" }'
```
## Development
You can spin the server up locally with the following.
```bash
docker build -f Dockerfile.build -t tectonic-api .
docker run --rm -e APP_PORT=7860 -p 7860:7860 tectonic-api
```