Skip to content

Includes GitBook parsers and normalize output

Notifications You must be signed in to change notification settings

gaearon/gitbook-parsers

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitBook Parsers

NPM version Build Status

This node module unify the interface to use parsers:

Parser Version Tests
Markdown NPM version Build Status
AsciiDoc NPM version Build Status
reStructuredText NPM version Build Status

How to use it?

This module can be used in node.js and in the browser

In the Browser:

Include the file:

<script src="library/gitbook-parsers.min.js" />
In Node.js:
npm install gitbook-parsers

Then include it using:

var gitbookParsers = require("gitbook-parsers");
Get a parser for a file:
var parser = gitbookParsers.getForFile("FILE.md");
Use this parser:

Parse the summary:

parser.summary("* [An entry](./test.md)")
.then(function(summary) {

});

Parse the glossary:

parser.glossary("...")
.then(function(glossary) {

});

Parse the languages index:

parser.langs("...")
.then(function(languages) {

});

Parse a page to html:

parser.page("...")
.then(function(sections) {

});

About

Includes GitBook parsers and normalize output

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%