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.
- install Node.JS (if not already installed)
- from command line execute:
$ npm install -g markdown-to-docs
$ 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
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 |
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).
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).
Works for PDF output only. Is set, images are fit to page width.
When turned on, changes all link to .md or .markdown files into links to .html or .pdf with same file name.
When turned on, input file should be HTML instead of markdown. Resulting HTML output does not have embedded images.
If set, details of processing is logged into console.
Displays all options with short description.
Displays version of application (match NPM/Git version number).
After install, run:
npm test