Parse out meta data from your markdown content


Parse meta Markdown data and render in the browser or server. You can add meta data in the format of

Page 1
tags: test
This is a _test_.

and automatically parse it out before rendering the markdown.

clone [url] && cd metamd
npm link
<script type="text/javascript" src="metamd.client.min.js"></script>
var fs = require('fs');
var metamd = require('metamd');
var parsed = metamd.parse(fs.readFileSync('./example/', 'utf-8'));

Will result in:

> { title: '',
    tags: 'test',
    body: 'Page 1\n=\n\nThis is a _test_.\n\n```\nThis is another test\n```' }
> <h1>Page 1
  <p>This is a <em>test</em>.
  <pre><code>This is another test</code></pre>

metamd.parse(<markdown>) - returns an object with meta data parsed out of the markdown. There will be a body key that contains the markdown.

metamd.render(<markdown>) - returns html rendered using marked.

Testing is done with mocha and chai and can be run on the server or client. Remember to install the dev dependencies before running the tests.

npm test

Maybe start a server, then navigate to test/browser/index.html.

If you make changes, you need to recompile for browser usage. After you install the dev dependencies, it's easy:

npm run compile