0.2.1 • Published 9 years ago
tokenize-markdown v0.2.1
tokenize-markdown
Get an array of markdown tokens per file from an array of files, optionally filtered to only those tokens matching a particular set of attributes
Installation
Install via NPM with npm install tokenize-markdown
.
Usage
var tokenizeMarkdown = require( 'tokenize-markdown' );
// Get all tokens
var tokens = tokenizeMarkdown.fromFiles( 'some_markdown_file.md' ] );
// Get only tokens of type "code" and lang "javascript"
var jsTokens = tokenizeMarkdown.fromFiles( [ 'slides/*.md' ], {
type: 'code',
lang: 'javascript'
});
// Get tokens of lang "javascript" or "html", using a regex
var jsOrHtmlTokens = tokenizeMarkdown.fromFiles( [ 'slides/*.md' ], {
lang: /(javascript|html)/
});
Credits
© 2015 K. Adam White, based on work by Tim Branyen
Released under the MIT License.