progbits 8 hours ago

I'm also building a blog with Typst, but I don't use the html export or the typst binary at all.

Instead I only use it as a markup language and use the typst libraries to evaluate it into blocks/AST which I then use together with askama templates.

This gives me a lot more flexibility, and typst is nicely extensible with custom typesafe functions. The downside is that existing LSP integrations don't recognize my custom keywords and show errors, something I just accept for now but might work around by importing a lib.ty stub (without real implementation, just matching signatures).

  • Rochus 3 hours ago

    Cool idea. So you essentially only use the Typst parser (i.e. the generated AST, I assume the text format of it)? With askama templates you essentially implement your own Typst renderer, which sounds like quite an achievement. May I assume that only a subset of Typst is supported by your renderer? What is the advantage of all this effort compared to e.g. Markdown or Asciidoc?

shakna 10 hours ago

The HTML target being unstable, meaning I can't really build a half-decent ePub target from it, is probably the key blocker for me strongly considering Typst for my workflow.

For now, it's an unhappy marriage of pandoc, LaTeX, and a 20k LOC Lua ecosystem for me.