Markdown internal metadata Re: Markdown validity

Waylan Limberg waylan.limberg at icloud.com
Sat Jul 12 21:27:45 EDT 2014


> On Jul 12, 2014, at 8:52 PM, Karl Dubost <karl at la-grange.net> wrote:
> 
> 
>> Le 13 juil. 2014 à 09:26, Sean Leonard <dev+ietf at seantek.com> a écrit :
>> Therefore, *when it matters*, what are strategies that Markdown users currently use to manage HTML metadata such as those metadata items defined in
> 
> search for multi-markdown.
> http://fletcher.github.io/MultiMarkdown-4/metadata

Yes, that is one example. A few other implementations have similar extensions. However, I think the best example is Jekyll [1], the static file generator behind GitHub Pages (admittedly, Jekyll is not a markdown parser, but a tool that uses one). Although its metadata syntax is not really that much different that the other metadata extensions, it is important to note that Jekyll supports more than one text format (markdown, textile). Behind the scenes, the code removes the "frontmatter" first (which is passes on to a YAML parser), then passes the remaining text on to the appropriate parser. The point is that the one file contains 2 documents: a YAML document and  markdown document; each parsed by a separate tool. So, while other markdown parsers may parse the frontmatter with the same tool, I still think of the metadata as being something other than markdown.

I should also point out that a number of projects will use the first <h1> Header in the document as the title. And if the file is stored on the file system, the creation and modification date may be pulled from the file system.  Some even use the file name for the title (converting underscores to spaces and title casing). But those are the least flexible systems. The most flexible systems generally store the metadata in separate columns in a database alongside the markdown.

One thing is for certain, there is absolutely no standardization regarding metadata associated with markdown documents and many (most?) parsers do nothing to address the issue.

IMO, pure markdown is just human readable HTML fragments. That, I guess, is part of the reason why I asked why we need a mime type way back in my first response. Those HTML fragments don't really stand on there own, so why would a pure markdown file be transported on its own outside of some container that contains all that other metadata? Especially when that container already has a mime type of its own.

[1]: http://jekyllrb.com/docs/frontmatter/

Waylan


More information about the Markdown-Discuss mailing list