Skip to content
This repository was archived by the owner on Apr 20, 2025. It is now read-only.

Latest commit

 

History

History
69 lines (45 loc) · 1.07 KB

File metadata and controls

69 lines (45 loc) · 1.07 KB

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) {

});