Skip to content
A Jekyll Markdown parser using TypeScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
test
.gitignore
.travis.yml
LICENSE
README.md
package-lock.json
package.json
tsconfig.json
tslint.json

README.md

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)

You can’t perform that action at this time.