Hint: This Post is written in typst and converted by typlite into markdown.
One day I told the idea about a possible conversion path: typst to HTML (XML) to any other markup formats. I said: just
#show
it, and you will get a markdown README or a latex paper. @hongjr03 was interested and started to work on it. Basicially, it converts a typst document with a single show rule:#show: convert-to-markdown = My document
Typlite was an internal tool used for converting Typst Package Docs to LSP Markdown Docs. It originally performs conversion using a hand-written interpreter, that interprets Typst AST into Markdown Document. It was working like a pandoc.
Now, typlite starts to convert Typst into diverse markup formats using the experimental HTML export.
The difference between typlite and pandoc is that typlite compiles documents using the official typst compiler, so it will not misinterpret your scripts. You can define your own functions, for example:
#let my-terms = state("my-terms", (..))
#let term(it) = context my-terms.get().at(it, default: it)
And you can use it like:
#let first-order-logic = term("First-order Logic")
The #first-order-logic is a collection of formal systems ...
and it gets converted into:
The [First-order Logic](https://en.wikipedia.org/wiki/First-order_logic) is a collection of formal systems ...
Since currently document styles are lost in HTML export, typlite also cannot keep most of them, but we think of it will be improved in the future.
Use Cases
- Typst to Markdown: You can write READMEs in typst.
- Typst to LaTeX/DocX: You can write and distribute papers in typst, but submit LaTeX/Docx output to those publishers that still only accept LaTeX/DocX.
Download URL: Release v0.13.14 · Myriad-Dreamin/tinymist · GitHub
See Docs: Exporting to Other Markup Formats for README.typ and IEEE paper examples.