Package detail

jekyll-markdown-parser

bouzuya42MITdeprecated4.0.0

Use front-matter instead.

A Jekyll Markdown parser using TypeScript

readme

jekyll-markdown-parser

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

npm version Travis CI

License

MIT

Author

bouzuya <m@bouzuya.net> (http://bouzuya.net)

changelog

4.0.0 (2020-01-25)

  • build!: drop support for node.js v8 (830780e)
  • build: add eslint and prettier (4894bf9)
  • build: bump @types/js-yaml to 3.12.2 (5d758dd)
  • build: bump sinon to 8.1.1 (8774f9f)
  • build: fix npm run watch (6c215ce)
  • build: remove tslint (2905834)
  • build: update babel to 7.8.3 (ab8ae18)
  • refactor: apply eslint (6742cb5)
  • style: apply prettier (f9bca2a)

BREAKING CHANGE

  • drop support for node.js v8

3.0.0 (2019-12-28)

2.0.0 (2019-04-15)

1.1.1 (2018-01-07)

1.1.0 (2017-10-13)

1.0.1 (2017-08-27)

1.0.0 (2016-10-09)

0.1.3 (2016-09-10)

0.1.2 (2016-07-30)

0.1.1 (2016-07-30)

0.1.0 (2016-07-30)