Voorhoede Ocelot Formatter
Format plain content as Voorhoede pages
Install
Voorhoede Ocelot Formatter is written in Node.js and can be installed via npm:
$ npm install voorhoede-ocelot-formatter
Usage
You can use Voorhoede Ocelot Formatter both as a CLI tool and programmatically in JS.
CLI
Convert markdown file to HTML and log output to the console:
$ formatter README.md
Convert markdown file to HTML and output content to an HTML file using --output
:
$ formatter README.md --output path/to/output/file.html
Options
Document language
The default document language is set to 'en'. You can specify another language using --lang
:
$ formatter README.md --lang nl
Table of contents levels
By default the table of contents renders heading levels 2 to 6. You can specify different ToC levels using --toc
:
$ formatter README.md --toc 3..4
Convert markdown file to HTML and specify that no ToC should be rendered using --noToc
:
$ formatter README.md --noToc
Link to Github repo
You can add a link to your Github repo by using --github
:
$ formatter README.md --github username/reponame
JS
To use Voorhoede Ocelot Formatter programmatically import the voorhoede-ocelot-formatter
module.
The formatter expects content in markdown (string) as an argument.
The formatter returns a promise which resolves with the content as HTML (string).
const formatter = ;const readme = '#content in *markdown*'; ;
The way you read or fetch a file is up to you, as is the way you handle the output. E.g, you can fetch content from a remote URL and log the output to the console:
;
or you can read a file from disk and write the output to an HTML file:
fs;
Options
Document language
The default document language is set to 'en'. You can specify another language:
Table of contents levels
By default the table of contents renders heading levels 2 to 6. You can specify different ToC levels:
Specify that no ToC should be rendered:
Link to Github repo
You can add a link to your Github repo:
Formatting options
Footer
If you want to have content displayed in the footer, you can add a horizontal rule (---
) in your markdown content.
All content below the last horizontal rule will be displayed in the footer.