vmg / sundown

Standards compliant, fast, secure markdown processing library in C
1.99k stars 385 forks source link

Support for metadata extension #109

Open brianly opened 12 years ago

brianly commented 12 years ago

I cloned the Misaka project and grep'd for "meta" but I didn't turn up an useful references to support for handling document-level metadata. Then I did the same with Sundown and couldn't find anything. It seems like this is something that Sundown needs to support before an upstream wrapper can support it. Am I right here, or is this information exposed somewhere that would allow me to patch Misaka?

If not, are there any plans to support a metadata extension like the one provided with Python-Markdown?

gampleman commented 12 years ago

Typically you can use a simple regexp to parse that stuff for yourself, which is typically super easy to do because both of the standards on meta-data require meta-data to be at the top of the file.

The two standards are the MultiMarkdown syntax:

Title: Title of Document
Author: Author's Name
Date: June 15, 2010
Arbitrary_key: arbitrary metadata spanning multiple 
                          lines

Pandoc meta-data:

% Title of Document
% Author's Name
% June 15, 2010

Pandoc has no support for arbitrary meta-data, only the three standard fields of Title, Author(s), and Date.

MMD is more useful for programmers, but Pandoc's syntax is IMO more elegant and more in spirit with Markdown's easy readability ideals.