parse-markdown-metadata
Simple helper to parse a markdown formatted string and pull out any metadata / properties present. This module assumes the format being used is like this. In short it expects:
- all metadata to appear at the top of the markdown source.
- wrapped values to start aligned in same position as first line
- multilined values to end each preceeding line with two spaces
Example
Title: Parse Markdown MetadataDescription: Description of this npm module is that it helps you out by pulling out metadata from markdown sources for you.Multilined: line one line two line three # Welcome to my markdown page Let's write some things...
This string can be parsed as follows;
var ParseMarkdownMetadata = ;var fs = ; var source = fs;var md = source; console;
The ParseMarkdownMetadata
object, has the following useful values;
{
props: {Object}
content: {String}
}
props
is an object of parameters to their corresponding value.
content
is the markdown string with the metadata stripped from it.