-
Notifications
You must be signed in to change notification settings - Fork 1.6k
CLI tool
Showdown comes bundled with a simple CLI tool that let's you run showdown converter from the command line.
In order to use it you need nodejs installed in your system.
If you install showdown globally with npm install showdown -g
, you can access the CLI tool help by typing in the command line:
showdown -h
A simple usage example would be:
showdown makehtml -i foo.md -o bar.html
This command reads foo.md
and writes the converted html into bar.html
This command converts a markdown input into html
showdown makehtml [options]
Here's a list of options for makehtml command
- short: -i
- alias: --input
- Description: Input source. Usually a md file. If omitted or empty, reads from stdin
- Examples:
-
showdown makehtml -i
: Reads from stdin (and outputs to stdout) -
showdown makehtml --input foo.md
: Reads from the file foo.md (and outputs to stdout)
-
- short: -o
- alias: --output
- Description: Output target. Usually a html file. If omitted or empty, writes to stdout
- Examples:
-
showdown makehtml -i foo.md -o bar.html
: Reads from the file foo.md and outputs to bar.html
-
- short: -u
- alias: --encoding
- Description: Specifies the input encoding
- Examples:
showdown makehtml -u UTF8
- short: -a
- alias: --append
- Description: Append data to output instead of overwriting
- Examples:
showdown makehtml -a
- short: -e
- alias: --extension
- Description: Load the specified extensions. Should be valid paths to node compatible extensions
- Examples:
showdown makehtml -e ~/twitter.js -e ~/youtube.js
(since v2.0.1)
- short: -c
- alias: --config
- Description: Enables/disables parser options.
- Examples:
showdown makehtml -i foo.md -o bar.html -c strikethrough
showdown makehtml -i foo.md -o bar.html -c strikethrough -c emoji
In showdown's version 1, if you specify any supported showdown options, those will be passed to the converter. For instance, if you want to activate strikethrough support, you can run the following command:
showdown makehtml -i foo.md -o bar.html --strikethrough
NOTE: Please note that all of the "extra options" are DISABLED by default in the cli tool. This differs from the behavior in node/browser, in which some options, such as ghCodeBlocks, are enabled (for backwards compatibility and historical reasons).