DEPRECATED: Use npm:front-matter and npm:marked instead.
A Jekyll Markdown parser using TypeScript.
$ npm install jekyll-markdown-parser
import * as assert from 'assert';
import { parse } from 'jekyll-markdown-parser';
const jekyllMarkdown = [
'---',
'layout: post',
'title: Hello Jekyll',
'---',
'This is my first entry.',
].join('\n');
assert.deepEqual(parse(jekyllMarkdown), {
html: '<p>This is my first entry.</p>\n',
markdown: 'This is my first entry.',
parsedYaml: {
layout: 'post',
title: 'Hello Jekyll',
},
yaml: 'layout: post\ntitle: Hello Jekyll\n',
});
or use compileMarkdown
/ parseYaml
/ separate
. See test/index.ts
.
bouzuya <[email protected]> (http://bouzuya.net)