markdown-doc-builder
Markdown documents builder. Can output .md and .html files
1. Usage
npm install --save markdown-doc-builder
Using markdown-doc-builder is quite easy:
; // output md .newBuilder .h1'Hello' .text'world' .toMarkdown; // output HTML .newBuilder .h1'Hello' .text'world' .toHtmlmarkdown.defaultHtmlStyles;
2. API
2.1. Headers
Use the h1, h2, h3, h4, h5, h6 or header to generate a markdown header. Calling header with a level above 6 returns a h6 Header.
; markdown .newBuilder .h1'Usage' .h1'API' .h2'Headers' .h2'Emphasis' .h2'Lists' .h2'Table' .toMarkdown;
2.2. Emphasis
; markdown .newBuilder .bold'This is bold text' .italic'This is italic text' .boldItalic'This is bold-italic text' .strikethrough'This is strikethrough text';
2.3. Lists
; markdown .newBuilder .list; markdown .newBuilder .list;
2.4. Table
; .newTableBuilder0, 2 .header .appendRow .appendRow .appendRow); markdown .newBuilder .tabletable .toMarkdown;
2.5. Link
; markdown .newBuilder .link'https://github.com/arnozhang/markdown-doc-builder', 'markdown-doc-builder' .toMarkdown;
2.5. Image
; markdown .newBuilder .image'https://octodex.github.com/images/minion.png', 'Minion' .toMarkdown;
2.6. Code
; markdown .newBuilder .compositeNodes markdown.text'Inline ', markdown.code'code' .toMarkdown; markdown .newBuilder .codeBlockMarkdownCodeType.Json, JSON.stringify, null, 4 .toMarkdown;
3. Output HTML
; .defaultStyles .globalCss"body {color: #000; font-size: 15px;}"; .newBuilder .xxx .toHtmlstyles;