marked-metadata
Markdown parser (using marked) with metadata header support.
Installing
npm install marked-metadata
Then, just require marked-metadata in your project:
var mkmeta = ;
How to use
marked-metadata was built on top of the awesome marked.
But sometimes you need some meta information about the markdown file.
Normally a pattern like is used to define a header metadata:
<!--layout: posttitle: hello world-->
Or something like this pattern:
---layout: posttitle: hello world---
With marked-metadata you can parse any header metadata, using the defineTokens method:
var md = './test/test.md';md;
You can get just the markdown metadata:
var md = './test/test.md';md;var meta = md;
And you can get just the markdown content (without the header)
var md = './test/test.md';md;var content = md;
You can crop a markdown file by a given identifier:
var md2 = './test/test.md';md2;md2;
Contribute
Fork > Pull-request
Tests
npm test