Support for Front Matter?
See original GitHub issueI have a blog with markdown files generated by Jekyll. They use Markdown files that has a metadata block on top that contains yaml. Is this something that mistune would be willing to support? Jekyll is a very common blog engine, so I think it would be useful to many!
---
id: 29
title: How this website was built
date: 2005-12-20T00:00:36
categories:
- CSS
---
Hi there early readers!
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:10 (2 by maintainers)
Top Results From Across the Web
Front Matter - Hugo
Hugo supports four formats for front matter, each with their own identifying tokens. TOML: identified by opening and closing +++ . YAML: identified...
Read more >Support Front Matter for GitHub Pages · Issue #144
Description. If making markdown files for GitHub Pages, a header in the Front Matter format is needed. It would be nice if this...
Read more >Front Matter
Front Matter helps with setting up and maintaining cloud infrastructure for scholarly services. Public Cloud Providers. Help with running scholarly ...
Read more >Front Matter: What it is and Why it is Important | Scribendi
In this article, we define front matter and give examples of what can be included.
Read more >Front Matter - Article - Formatting - Author Learning Center
Front matter is the content of your book preceding the main body text. Learn what's included in front matter, the sequence, and why...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For posterity, @karlcow 's snippet above is missing a line; the full version is here: https://github.com/lepture/mistune-contrib/blob/master/mistune_contrib/meta.py
@EmilStenstrom let me know if you ended up with a gist of the above, I’m playing around with something similar
In case it helps other people interested in YAML frontmatter processing: consider using https://github.com/eyeseast/python-frontmatter.
(To clarify, this post does not suggest to change mistune. A user of mistune can use python-frontmatter on the file before invoking mistune.)
Here is a simple example:
Where text.md is something like this: