1.0.2 • Published 6 months ago
@honkit/light-parsers v1.0.2
HonKit Light Parsers
This node module unify the interface to use parsers. It's a light (simplified) implementation of parsers for HonKit:
Parser | Repository |
---|---|
Markdown | honkit/markdown-legacy |
AsciiDoc | honkit/asciidoc |
How to use it?
This module can be used in node.js
Installation
npm install @honkit/light-parsers
Usage
import honkitParsers from '@honkit/light-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) {
});