Support for org-mode

I’m a long-time Emacs user, and I have an extensive static website authored completely in org-mode, published using a pile of hacky Emacs Lisp kludges that I’ve built up over the years to augment org-mode’s native ox exporter framework.

I’m currently evaluating moving everything over to a better maintained static site generator, and Zola is my number one choice, in no small part because I’m a Rust developer, and I’m much more comfortable in a Rust ecosystem than in a language ecosystem for something like Hugo or Jekyll.

I do not expect that this would a high priority feature request, but I would love to see org-mode support. I’m happy to help contribute to it, even if it ends up being only for my own use.

Is there any interest in adding org-mode to exist along side Markdown?

1 Like

It’s not planned no. The only alternative document I would probably consider is Asciidoc but even that is too niche to be worth the time/support investment.

Completely understandable, it’s pretty niche, as you say.

If I were to work on it in a fork, would you consider potentially bringing into the main project at some point in the future as a pull request, assuming it was well vetted and tested, and that it could be supported?

Like Keats said it may become a maintenance burden over time, but if you see yourself as a long-term contributor and you’re willing to maintain that i’m sure many people will be interested :wink:

From a quick overview of the code, a few notes about potential implementation:

  • rendering: rendering::render_content() should be able to call an org-mode parser/renderer when given more context (such as file extension). It should just always return a Result<rendering::markdown::Rendered>, which should be placed outside of markdown mod to be shared with and org-mode mod ; this Rendered includes internal links, toc, summary length, external links, and rendered HTML body
  • library: building the library happens in site::load(), where non-Markdown files are currently filtered out
  • shortcodes: rendering::shortcode::render_shortcode() should be modified to load your org-mode shortcodes as template_name ; tpl_glob in site::tpls::load_tera should also glob your org-mode shortcodes

Happy hacking to you @twylo :slight_smile:

@keats What the markdown renderer does (markdown_to_html) is really useful though not overcomplicated. Could we hypothetically turn it into an autonomous crate that can be reused for other projects (because many people end up rewriting a such function), and that could potentially in the future be extended to support AsciiDoc and org-mode without cluttering the zola codebase or becoming a burden? (zola-side, maybe we don’t need source-specific shortcodes (the .md shortcodes don’t do anything special, they’re just rendered before HTML production) but a simple mapping of site-loaded file-extensions to a rendering backend)

2 Likes

It’s more about the maintenance/support cost as you mention. Every new feature needs to be added to each backend along with tests and to be honest it’s hard to rely on external contributors for fixes since everyone has their own things going.

It’s something that could potentially be added once all the big features are done and Zola covers the most essential features and the warts are removed: proper i18n support, paths unification etc but I would rather focus on that now.

1 Like

That’s fair, I will hold off on working on it as a feature for now, and perhaps I can revisit it at a later time. For now, I’m sure I can use Pandoc to convert my existing files from org to Markdown.

I don’t think it’s a problem when some features are not implemented for specific formats. As long as there’s a clear feature table in the docs, users are already used to format-based limitations (in every software, not just static site generators).

I wholeheartedly agree :slight_smile: . Zola is already quite impressive, but with those two huge refactors out of the way it will become increasingly easier to build with/upon.

The choice is yours :slight_smile:

There actually is. I much prefer org to Markdown as there is only one org standard which covers everything Markdown has - and more. Sadly, this request has been dismissed a few times in the past already.

I still plan to work on org-mode support at some point in the future, I do think it would be worthwhile. I’m not quite ready to commit to it immediately, but hopefully I can tinker with it to see how difficult a task it would be in the near future.

2 Likes

I’d help you with the tests if required. :slight_smile:
It would probably even enable forking org2blog…

I am coming from hugo using ox-hugo to generate md-files from the org-roam-v2 files and then running hugo to generate them into html.

What do you mean with “org-mode” support in that thread? Should zola be able to generate HTML directly from org-files? Awesome this would be my friend! :wink:

@twylo Can you give us an update about the current state of your work? Maybe you need a tester?

I would also mention not only org but org-roam. I am not experienced with org but org-mode. In org-roam-mode (version 2!) the org-files are linked together not by there filename but by there ID. This is a bit tricky.

If there is a plan to get org support into zola it would be great to have org-roam support, tool.