I just wrote a Typst backend for Documenter.jl and managed to build the latest Julia documentation.
Footnotes are not supported yet, while math equations are kept as is since Typst uses a different grammar and there is no translator available at the moment.
A big advantage is the compilation speed. On my computer, the whole documentation can be compiled within ~13 min. And I believe there is still much room for improvement.
Official Typst does not support syntax highlighting for Julia yet, I have made a PR, but it is currently blocked by upstream packages. There are still some issues with syntax highlighting, e.g., in some cases, all code after # are taken as comments.
Because interpolation always copies. (If the copies are actually very heavy I’d stick the assignment in both places and inside the most nested loop, but YMMV.)
That said… I look forward to the compilation not taking ~13mins Happy perf hunting!
Sorry if this is a daft question: what is the point of another backend (in addition to those that already exist)? These all output the same documents? Don’t they?
If all tex files are exported and compiled 3 times in draft mode using lualatex , it only takes about 4 minutes.
This means that about 90% of the time is spent on generating code highlights via the minted macro package.
Why typst is fast?
Fast compile times thanks to incremental compilation
May be i am misunderstanding, but it sounded as if right now no coloring of code was done with Typst. And, the source code coloring with Pygments was the reason the build took so long. So how will things be better with Typst once one throws the syntax coloring in?
Just confirmed that the bottleneck is not syntax highlighting for typst. After turning off the outline, header, and footers (which are all implemented by myself), the compilation time is only 49s.
Another way of doing something? So what? That’s the whole point of progress, to explore new tools, find out their shortcomings, cure them if poss. and then we all have a choice: get rid or adopt! Brilliant! Long-live lateral exploration!
Faster is very nice. But another advantage that is even more important for me is that Typst math syntax is a lot more readable uncompiled. Examples: there are no backslashes, no curly-braces, and a/b turns into a pretty fraction automatically. Why is that important?
Many docstrings include LaTeX to render nicely in the documentation. But often it is the only representation of some key mathematical relation, and it is really hard to read when you get the docstring in the REPL (or with mouse-over from a language server).
So math that both compiles pretty and is readable uncompiled for docstrings is something I would really love, and something Typst brings to the table.
julia> function f end
f (generic function with 0 methods)
julia> @doc """
Some function
``\\frac{1}{2}\\lvert\\alpha\\rvert + \\beta^2 - \\varphi``
""" f
f
help?> f
search: f fd for fma fld fit fld1 fill fdio fit! frexp foldr foldl flush floor float first fill! fetch fldmod
Some function
¹/₂|α| + β² − φ