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

Support YAML front matters #97

Open
af4jm opened this issue Dec 3, 2022 · 3 comments
Open

Support YAML front matters #97

af4jm opened this issue Dec 3, 2022 · 3 comments

Comments

@af4jm
Copy link

af4jm commented Dec 3, 2022

YAML front matters (as used by assemble, hugo [static website renderers], zettlr, obsidian [editors/note-taking tools], and pandoc) should either be ignored, or treated as metadata (rendered possibly as a table, or possibly in the box with the Contents).

rendering it as a header also has the side effect that, because there is no <title> tag & the first header becomes the title, that the raw YAML (with line breaks stripped) becomes the text in the browser tab.

an example front matter & first header from a file that is notes from reading a book... in this case the ideal title would be Supernatural, Michael Heiser (2015) but it's actually citekey: heiserSupernaturalWhatBible2015 ebook: - https://read.amazon.com/?_encoding=UTF8&asin=B016LT2YHA

---
citekey: heiserSupernaturalWhatBible2015
ebook:
    - https://read.amazon.com/?_encoding=UTF8&asin=B016LT2YHA
---

# *Supernatural*, Michael Heiser (2015)
@Cimbali
Copy link
Owner

Cimbali commented Dec 3, 2022

Where are YAML front matters defined? It’s definitely not plain markdown. If there is a renderer extension for it it’s easy enough to add.

@Cimbali
Copy link
Owner

Cimbali commented Dec 3, 2022

ParkSB/markdown-it-front-matter would probably do the trick though it seems not to render the content of the front matters.

@Cimbali Cimbali changed the title YAML front matter should not be rendered as if it were Markdown Support YAML front matters Jan 6, 2023
@af4jm
Copy link
Author

af4jm commented Jul 7, 2024

forgot about this, but there is a kind-of work-around that I found for this issue... I add a blank line before the --- that ends the front matter... then it at least doesn't get interpreted as a Markdown header, so the front matter renders as pain text between 2 line breaks... still not great, but better than borking it into a top-level header

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

No branches or pull requests

2 participants