From 261a8e7a3c6573b03227ac08ecb04ced8964f3b6 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 | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..dc1d5ab --- /dev/null +++ b/README.md @@ -0,0 +1,30 @@ +# tectonic-api + + +[![linting: pylint](https://img.shields.io/badge/linting-pylint-yellowgreen)](https://github.com/PyCQA/pylint) +[![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). + +## 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 +```