Without the Markdown rules defining such a format everyone has done their own slightly different interpretation resulting in a lot of variety. Unfortunately, I have never seen any two which behaved exactly the same. The MultiMarkdown parser includes a bunch of additional options which are unique to that parser, but the key-value metadata is used across multiple parsers. Here is an example from the MultiMarkdown docs: Title: A Sample MultiMarkdown DocumentĬomment: This is a comment intended to demonstrate And while the syntax looks very similar to YAML, only key-value pairs are supported with no implied types. While it has more recently been updated to optionally support YAML deliminators, traditionally, the metadata ends and the Markdown document begins upon the first blank line (if the first line was blank, then no metadata). The older and simpler MultiMarkdown Metadata is actually incorporated into a few Markdown parsers. Note that YAML front matter is not parsed by the Markdown parser, but is removed prior to parsing by Jekyll (or whatever tool you're using) and could actually be used to request a different parser than the default Markdown parser for that page (I don't recall if Jekyll does that, but I have seen some tools which do). Here is an example from the Jekyll docs:. And the metadata is defined using any valid YAML syntax. Yes, the dashes are actually part of the YAML syntax. The Jekyll static site generator popularized YAML front matter which is deliminated by YAML section markers. There are two common formats that look very similar but are actually different in some very specific ways.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |