gitbook-parsers

0.8.9 • Public • Published

GitBook Parsers

NPM version Build Status

This Javascript module provides a low level parsing interface for GitBooks. The API is promise-based, and this module can be used in both Node.js and the Browser.

Parsers

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

Usage

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");
Find 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) { ... });

Readme

Keywords

none

Package Sidebar

Install

npm i gitbook-parsers

Weekly Downloads

186

Version

0.8.9

License

Apache-2.0

Last publish

Collaborators

  • samypesse