Doctave / doctave

A batteries-included developer documentation site generator
https://cli.doctave.com
MIT License
565 stars 32 forks source link

Add support for reading frontmatter in TOML #19

Open mscno opened 3 years ago

mscno commented 3 years ago

Currently the parser only supports frontmatter in yaml format:

---
title: "my title"
---

For compatability with other SSGs it would be cool to also support TOML format in the frontmatter

+++
title= "my title"
+++

The two are equivalent, but the toml is surrounded by +++ instead of ---.

As an example Zola SSG (getzola.org) supports both.

begleynk commented 2 years ago

Thanks for opening this. Could you talk a bit about what you had in mind when you say "compatibility" with other SSGs? Just making it easier to move from another SSG to Doctave? Or did you have a specific case/workflow in mind?

This seems like a fine addition, but I think realistically it's going to be a bit lower priority compared to some larger features and important fixes coming up.

mscno commented 2 years ago

The motivation was that I have a bunch of markdown files that are currently used in Zola. Zola supports reading toml files and these files were originally specified with toml frontmatter. In order to use these files with Doctave, Doctave would need to support reading toml frontmatter. However, I ended up migrating these files to yaml since Zola supports both formats.

Fully agree that this should be a lower priority enhancement, as there are workarounds available.