elliotblackburn / mdpdf

Markdown to PDF command line app with support for stylesheets
https://npmjs.com/package/mdpdf
Apache License 2.0
712 stars 46 forks source link

Handle Metadata defined at the top of a md file #88

Open travs opened 4 years ago

travs commented 4 years ago

Right now the metadata is displayed literally, between two horizontal lines. We could handle this with showdown, and either ignore it as output, or add metadata to the html.

var conv = new showdown.Converter({metadata: true});
var html = conv.makeHtml(someMd);
var metadata = conv.getMetadata(); // returns an object with the document metadata
adriaandotcom commented 3 years ago

I use https://github.com/dworthen/js-yaml-front-matter for that, works only with strings though.