Hacker News new | past | comments | ask | show | jobs | submit login

Have you thought about YAML headers in the doc? Lots of site-generators (eg Hugo) do that.



Yes, I have. I disagree with adding YAML headers into documents because it inevitably mixes presentation with content. KeenWrite takes a different approach in keeping presentation completely separate, allowing the content to vary independently. Aside, KeenWrite generates XHTML documents as an intermediary step towards producing PDF files, making it an alternative site generator.

Nonetheless, if someone wants to use an existing site generator, they can do so while keeping their Markdown documents free of presentation logic. In Linux, it can be as simple as:

    cat header.yaml source.md > combined.md
Then run the site generator on the combined output file.

In the screenshots, the theme-driven PDF output shows the same content presented in two different PDF files: one with a ToC and one without. Whether a table of contents is included is presentation logic, dictated by the typesetting engine configuration. If you place the ToC controls in the YAML header for the document, then it means having to change the content to add or remove the ToC. That then presumes the type of transformations the Markdown will undergo, which, IMO, defeats the purpose of a plain text document.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: