tokenize-markdown

0.2.1 • Public • Published

tokenize-markdown

Build Status

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.

Readme

Keywords

none

Package Sidebar

Install

npm i tokenize-markdown

Weekly Downloads

0

Version

0.2.1

License

MIT

Last publish

Collaborators

  • kadamwhite