A Markdown to HTML converter written in Javascript
—
CLI tool for converting Markdown files to HTML with full option support and extension loading.
Main command for converting Markdown to HTML via command line.
showdown makehtml [options]-i, --input [file] # Input source (file path or stdin)
-o, --output [file] # Output target (file path or stdout)
-u, --encoding <encoding> # Input encoding (default: utf8)
-y, --output-encoding <encoding> # Output encoding (default: utf8)
-a, --append # Append to output file instead of overwriting-p, --flavor <flavor> # Use predefined flavor (vanilla, github, ghost, original)
-c, --config <config...> # Enable parser options
-e, --extensions <extensions...> # Load extensions (file paths)--config-help # Show available configuration options
-q, --quiet # Quiet mode (only print errors)
-m, --mute # Mute mode (print nothing)
-h, --help # Show help information
-V, --version # Show version number# Convert file to HTML
showdown makehtml -i input.md -o output.html
# Convert from stdin to stdout
echo "# Hello World" | showdown makehtml
# Read from stdin, write to file
showdown makehtml -i -o output.html < input.md# Use GitHub Flavored Markdown
showdown makehtml -i input.md -o output.html --flavor github
# Use Ghost flavor
showdown makehtml -i input.md --flavor ghost
# Use original Markdown behavior
showdown makehtml -i input.md --flavor original# Enable specific options
showdown makehtml -i input.md -c tables strikethrough ghCodeBlocks
# Enable options with values
showdown makehtml -i input.md -c prefixHeaderId="section-"
# Combine flavor with custom options
showdown makehtml -i input.md --flavor github -c emoji=false# Load single extension
showdown makehtml -i input.md -e ./my-extension.js
# Load multiple extensions
showdown makehtml -i input.md -e ./ext1.js ./ext2.js ./ext3.js
# Combine with other options
showdown makehtml -i input.md --flavor github -e ./highlight.js -c tables# Specify input encoding
showdown makehtml -i input.md -u utf16le
# Specify both input and output encoding
showdown makehtml -i input.md -u utf8 -y ascii
# For Windows users with special characters
showdown makehtml -i input.md -u utf8# Append to existing file
showdown makehtml -i input.md -o output.html --append
# Quiet mode (only errors)
showdown makehtml -i input.md -o output.html --quiet
# Mute mode (no output)
showdown makehtml -i input.md -o output.html --muteView all available configuration options:
showdown makehtml --config-helpThis displays detailed information about all parser options including:
showdown makehtml -i README.md -o README.html \
--flavor github \
-c ghMentionsLink="https://github.com"showdown makehtml -i post.md -o post.html \
-c tables \
-c strikethrough \
-c headerLevelStart=2 \
-c prefixHeaderId="post-"showdown makehtml -i doc.md -o doc.html \
-e ./syntax-highlight.js \
-c ghCodeBlocks \
-c tablesThe CLI provides informative error messages:
# File not found
showdown makehtml -i nonexistent.md
# ERROR: Could not read from file nonexistent.md, reason: ENOENT: no such file or directory
# Invalid extension
showdown makehtml -i input.md -e ./bad-extension.js
# ERROR: Could not load extension ./bad-extension.js. Reason: [error details]
# Invalid flavor
showdown makehtml -i input.md --flavor invalid
# ERROR: invalid flavor was not found0: Success1: Error (file not found, invalid options, conversion failure, etc.)For Windows users dealing with encoding issues:
# Set command line to UTF-8 before running
chcp 65001
# Then run showdown
showdown makehtml -i input.md -o output.htmlOr specify encoding explicitly:
showdown makehtml -i input.md -o output.html -u utf8# From curl
curl -s https://raw.githubusercontent.com/user/repo/main/README.md | showdown makehtml
# From echo
echo "**Bold text**" | showdown makehtml
# From cat
cat *.md | showdown makehtml --flavor github# Pipe to less for viewing
showdown makehtml -i large-doc.md | less
# Pipe to file with additional processing
showdown makehtml -i input.md | sed 's/old/new/g' > output.html
# Count output lines
showdown makehtml -i input.md | wc -lProcess multiple files:
# Using shell loop
for file in *.md; do
showdown makehtml -i "$file" -o "${file%.md}.html" --flavor github
done
# Using find and xargs
find . -name "*.md" -exec showdown makehtml -i {} -o {}.html \;--quiet or --mute for batch processing to reduce outputInstall with Tessl CLI
npx tessl i tessl/npm-showdown