Home

Awesome

Typst HTTP API

<!-- This sentence is from the typst repo -->

Typst is a new markup-based typesetting system that is designed to be as powerful as LaTeX while being much easier to learn and use. I recommend that you check it out if you don't know it yet.

This project is a web server that allows users to compile typst markup remotely by a simple API call. This webserver is provided in the form of a docker container. For now there is no official image on any registry.

I want to bring some elements to your attention:

Current version: v0.1.0

Build and run

Build the docker image

docker build . -t typst_image
# This command build an image using the Dockerfile at the root of the project,
# then tag it with "typst_image"

Create a container:

docker run -p 8000:8000  typst_image
# This command creates a docker container based on the image created at the last step

Send test.typ to the api and output the file to result.pdf:

curl -H "Content-Type:text/plain" --data-binary @test.typ  http://localhost:8000 --output result.pdf

Or more simply use httpie:

cat test.typ | http POST http://localhost:8000 > result.pdf