From 86a9c159d91c5e60e9875e588007c8942a30b70a Mon Sep 17 00:00:00 2001 From: winstxnhdw Date: Fri, 30 Jun 2023 02:55:29 +0800 Subject: [PATCH] docs: add README --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..bc96bc4 --- /dev/null +++ b/README.md @@ -0,0 +1,28 @@ +# tectonic-api + +[![main.yml](https://github.com/winstxnhdw/tectonic-api/actions/workflows/main.yml/badge.svg)](https://github.com/winstxnhdw/tectonic-api/actions/workflows/main.yml) +[![build.yml](https://github.com/winstxnhdw/tectonic-api/actions/workflows/build.yml/badge.svg)](https://github.com/winstxnhdw/tectonic-api/actions/workflows/build.yml) +[![warmer.yml](https://github.com/winstxnhdw/tectonic-api/actions/workflows/warmer.yml/badge.svg)](https://github.com/winstxnhdw/tectonic-api/actions/workflows/warmer.yml) +[![dependabot.yml](https://github.com/winstxnhdw/tectonic-api/actions/workflows/dependabot.yml/badge.svg)](https://github.com/winstxnhdw/tectonic-api/actions/workflows/dependabot.yml) + +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 'https://winstxnhdw-tectonic-api.hf.space/compile' \ + -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 SERVER_PORT=5000 -p 5000:5000 tectonic-api +```