1.0.6 • Published 8 years ago

supermark-extract v1.0.6

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

supermark-extract

Version npmBuild StatusDependenciesCoverage Status

Extract supermark properties from a markdown file

Installing

npm install --save supermark-extract

Usage

var fs = require('fs');
var extract = require('supermark-extract');

var markdown = fs.readFileSync('some-markdown-file.md', { encoding: 'utf8' });
var supermark = extract(markdown);

console.log(supermark);

Results in something along the lines of:

{
    "title": "Some document title",
    "excerpt": "An excerpt of the document can be used in lists, RSS-feeds etc",
    "slug": "some-document-title",
    "date": "2015-12-30T00:11:19.411Z",
    "status": "Draft",
    "visibility": "Private",
    "tags": ["List Of", "Random", "Tags"],
    "categories": ["Testing", "Blogging"],
    "author": "Espen Hovlandsdal <espen@hovlandsdal.com>",
    "errors": [],
    "intro": "Raw markdown source up to the first <!-- read more -->",
    "document": "Raw markdown source of the document, without the supermark header."
}

Ecosystem

This is a submodule of supermark.

License

MIT-licensed, see LICENSE.

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago