jekyll-markdown-parser

jekyll-markdown-parser

A Jekyll Markdown parser using TypeScript

jekyll-markdown-parser

DEPRECATED: Use npm:front-matter and npm:marked instead.

A Jekyll Markdown parser using TypeScript.

Installation

$ npm install jekyll-markdown-parser

Usage

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.

Badges

License

MIT

Author

bouzuya <[email protected]> (http://bouzuya.net)

Alternatives