Skip to content
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

Non-md content formats #2790

Open
vsheg opened this issue Feb 6, 2025 · 5 comments
Open

Non-md content formats #2790

vsheg opened this issue Feb 6, 2025 · 5 comments

Comments

@vsheg
Copy link

vsheg commented Feb 6, 2025

Hi,

Currently, Zola processes Markdown (with inline HTML allowed) as source content, while non‑Markdown files can be included from the static/ folder.

Alternatively, Hugo supports HTML natively and allows Pandoc integration to work with alternative formats.

Typst is a new, powerful typesetting language written in Rust that offers HTML export (still under development) [ref][ref]. Given that Zola is also written in Rust, supporting Typst as a first‑class content format would be natural and would allow authors to use Typst’s modern syntax and features without leaving the Zola ecosystem.

I’d like to hear the developers’ and community’s thoughts on alternative formats in Zola. Are there plans to allow this, or potentially to accept PRs?

Personally, I've started using Typst for my blog. I use Pandoc to convert Typst → Markdown and Quarto with a Make pipeline to build the website, but although Quarto is powerful (it allows to include HTML and Jupter notebooks), it's written in JS and is awfully slow. I'm considering switching to Zola (thanks for your work) or Hugo.

@cestef
Copy link

cestef commented Feb 7, 2025

I've been maintaining a fork of Zola that adds server-side math and diagram rendering, along with some caching improvements. Given Typst's strengths, I wonder if it could be integrated in a similar way—maybe as a build-time renderer for specific content blocks. If there's interest, I could share some of my work or explore how Typst might fit into Zola's architecture.

PS: nice blog, by the way!

@djoyce-ts
Copy link

Asciidoc would be nice too.

@Keats
Copy link
Collaborator

Keats commented Feb 9, 2025

The tricky part is handling shortcodes. It might be easier once content is actually templated (unlike now where shortcodes needs parsing). Asciidoc though it not getting any popular and not really bringing much to the table compared to typst for example

@vsheg
Copy link
Author

vsheg commented Feb 10, 2025

@cestef
Did I understand correctly that your fork modifies Zola’s internals to generate static HTML with math and diagrams? I’m not a Rust developer, but I assume Typst can be used directly as a crate. However, I’m unsure how likely the Zola developers are to accept Typst as a dependency, even as an optional one.
P.S. Thanks!

@djoyce-ts
Technically, if Zola supported HTML files natively, implementing an arbitrary format—e.g., via Pandoc—would not be difficult. If Typst were supported, its built-in WASM virtual machine and plugin system could enable native rendering of formats like LaTeX, as demonstrated by mitex. A similar plugin could be developed for rendering AsciiDoc in Typst.

@cestef
Copy link

cestef commented Feb 10, 2025

Typst by itself adds about 15-20MB to the binary, so yeah it's a pretty big boy 😄. The engine is able to do so much more than just plain math rendering so it makes sense.

The draft PR for math rendering: #2791 (katex and typst implementation)
My blog (source) is also using this if you want to see how it looks: https://blog.cstef.dev/lagrange/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants