YtoTech / latex-on-http

Compiles Latex documents through an HTTP API
https://latex.ytotech.com
GNU Affero General Public License v3.0
31 stars 5 forks source link

Multipart api v1 #8

Closed MonsieurV closed 4 years ago

MonsieurV commented 4 years ago

Allows compilation of a Latex project by sending the files in a multipart/form-data request.

The first file with a name containing the .tex extension will be taken as the main Latex document to be compiled. Other files are assumed to be non-main resources. If there is only one file sent, it is assumed to be the Latex file to be compiled.

A resources specification can also be sent in the multipart. It has to match the JSON resource spec API, with the addition the multipart resource mode (specify a multipart key where the file will be loaded from).

The compiler can be specified too, in a multipart compiler with the compiler name as value.

MonsieurV commented 4 years ago

This API should allow to create simple HTML form for compiling Latex document / snippets.

It may also be used as a no-dependency CLI-interface, by simply sending files:

curl -v -X POST https://latex.ytotech.com/builds/sync \
    -F "sample.tex=@sample.tex" \
    -F "logo.png=@logo.png" \
    -F "compiler=xelatex" \
    -o sample.pdf

The examples are to be provided and documented.