markdown-to-docs
v2.0.0
Published
Generates PDF and HTML from MARKDOWN document
Downloads
3
Maintainers
Readme
Markdown to Docs
markdown-to-docs is command line tool to convert Markdown files to HTML and PDF documents, embedding local images and replacing PNGs with SVGs if provided.
Setup
- install Node.JS (if not already installed)
- from command line execute:
$ npm install -g markdown-to-docs
Usage
$ markdown-to-docs [options] [path_to_markdown_file]
or
$ markdown-to-docs --convert [options] [path_to_html_file]
For full list of supported options execute:
$ markdown-to-docs -h
Options
All options are optional. When not specified, they are ignored or have default value. Boolean options are true if flag is present, false otherwise.
Option | Type
--- | :---:-p
, --pdf
| File Path
-w
, --html
| File Path
-f
, --fit
| Boolean
-r
, --relink
| Boolean
-c
, --convert
| Boolean
-v
, --verbose
| Boolean
-h
, --help
| Boolean
-V
, --version
| Boolean
Option pdf
Specifies output path for PDF file.
All local images are embedded. If it is only possible, SVG are used instead of raster files (if provided).
Option html
Specifies output path for HTML file.
All local images are embedded. If it is only possible, SVG are used instead of raster files (if provided).
Option fit
Works for PDF output only. Is set, images are fit to page width.
Option relink
When turned on, changes all link to .md or .markdown files into links to .html or .pdf with same file name.
Option convert
When turned on, input file should be HTML instead of markdown. Resulting HTML output does not have embedded images.
Option verbose
If set, details of processing is logged into console.
Option help
Displays all options with short description.
Option version
Displays version of application (match NPM/Git version number).
Testing
After install, run:
npm test