-
Notifications
You must be signed in to change notification settings - Fork 499
Experimental Typst backend #2102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
This looks interesting! I'll try to find some time to play with it properly. Would be awesome to also get more eyes on this, to see what people this about using this vs. the existing PDF/LaTeX backend. I do have some immediate thoughts about merging it here though:
|
|
I was not aware of the choice of Documenter plugins! That would be much better. Actually, I think the current HTML and LaTeX backend can also be made plugins. |
Just to maybe clarify -- Documenter plugins are not a thing that strictly exist as a feature (yet; I would like it to be an official feature though). So, right now, one has to dive into Documenter internals to make things work. However, I would like those necessary internal hooks to be documented and part of the public, semver-ed API, so that external plugin packages could depend on safely and cleanly.
I don't think we want The process for getting us those APIs will be a bit laborious though. I don't really want to declare the current state of the internal APIs be public. I think it should all be reviewed and documented step-by-step, and refactored as needed, to actually get a good API. But having existing extension packages, like the typst backend, is a great first step in clarifying the requirements of the internal API. A couple of examples of packages that extend Documenter in some ways that may be useful for you though: |
|
I just want to express my preferance for typst, mainly due to the fact that unrendered typst math is much more readable than latex, meaning that it is a better choice for docstrings. The faster compile-times should also help keep the "flow" in "workflow" if someone is using low-power servers to check if the docs are buildt correctly. Typst recently got footenote-support, and support for Julia syntax highlighting. Note that the footnotes can be a little jenky, as tracked in this issue. |
My 2c is just that LaTeX should be unicode-rendered in the REPL, it's possible, I've got a local package that does it. |
|
Regarding
I find typst technically superior and much more readable in the source code (no more forest of This means that in the long run we need to find a way for the two to coexist. Since mixing LaTeX and Typst syntax in the same document is perhaps an uncommon use case, maybe it would be best to be able to select the preferred syntax as a global option. This means that whatever is inside the |
|
I would imagine eventually the docs are written in Typst using a special Julia-provided Typst template? |
|
Being able to use Typst instead of LaTeX would be a real improvement for me. |
|
FWIW https://typst.app/universe/package/mitex/ exists which seems to be able to translate latex to typst inline inside a typst document, so math blocks might be able to continue to work? and maybe we declare to be special syntax for typst? |
I just wrote a Typst backend for
Documenter.jland managed to build the latest Julia documentation.https://drive.google.com/file/d/1IlqEI5b4Qc0CjuJ5u0l0Ma_MymRpWcrD/view?usp=sharing
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.