-
Notifications
You must be signed in to change notification settings - Fork 2
Command Line Options
Complete reference for all Apex command-line flags.
Display help message and exit.
apex --helpDisplay version information and exit.
apex --versionSet processor mode. See Modes for details.
Values:
-
commonmark- Pure CommonMark specification -
gfm- GitHub Flavored Markdown -
mmdormultimarkdown- MultiMarkdown compatibility -
kramdown- Kramdown compatibility -
unified- All features enabled (default)
Example:
apex --mode gfm document.mdWrite output to a file instead of stdout.
apex document.md -o output.htmlGenerate a complete HTML document with <html>, <head>, and <body> tags.
apex document.md --standaloneLink to a CSS file in the document head. Requires --standalone.
apex document.md --standalone --style styles.cssSet the document title. Requires --standalone. Default is "Document".
apex document.md --standalone --title "My Document"Pretty-print HTML with indentation and whitespace.
apex document.md --prettySet header ID generation format. See Header IDs for details.
Values:
-
gfm- GitHub Flavored Markdown format (default) -
mmd- MultiMarkdown format -
kramdown- Kramdown format
Note: Modes automatically set the format. This option is useful to override in unified mode.
apex document.md --id-format mmdDisable automatic header ID generation.
apex document.md --no-idsGenerate <a> anchor tags instead of id attributes on headers.
apex document.md --header-anchorsOutput:
<!-- Default -->
<h1 id="my-header">My Header</h1>
<!-- With --header-anchors -->
<h1><a id="my-header" href="#my-header">My Header</a></h1>Enable relaxed table parsing (tables without separator rows). Default in unified and kramdown modes.
apex document.md --relaxed-tablesDisable relaxed table parsing.
apex document.md --no-relaxed-tablesDisable table support entirely.
apex document.md --no-tablesDisable footnote support.
apex document.md --no-footnotesDisable smart typography (smart quotes, dashes, ellipsis).
apex document.md --no-smartDisable math support.
apex document.md --no-mathEnable file inclusion features.
apex document.md --enable-includesTreat newlines as hard breaks (GFM style). Newlines become <br> tags.
apex document.md --hardbreaksAccept all Critic Markup changes. Applies all additions, removes all deletions, keeps substitutions.
apex document.md --acceptBehavior:
-
{++add++}→add(kept) -
{--del--}→ (removed) -
{~~old~>new~~}→new(kept) -
{==mark==}→mark(markup removed) -
{>>comment<<}→ (removed)
Reject all Critic Markup changes. Reverts all changes, keeps original text.
apex document.md --rejectBehavior:
-
{++add++}→ (removed) -
{--del--}→del(kept) -
{~~old~>new~~}→old(kept) -
{==mark==}→mark(markup removed) -
{>>comment<<}→ (removed)
If no file is specified, Apex reads from stdin:
echo "# Hello" | apex
cat document.md | apex > output.htmlBy default, Apex writes to stdout. Use -o or > to redirect:
apex document.md > output.html
apex document.md -o output.htmlYou can combine multiple options:
# Standalone document with custom title and stylesheet, pretty-printed
apex document.md --standalone --title "Report" --style report.css --pretty
# GFM mode with no header IDs
apex --mode gfm --no-ids document.md
# Unified mode with MMD-style header IDs
apex --mode unified --id-format mmd document.mdOptions are processed in order. Later options override earlier ones:
# This will use GFM mode (unified is default, but --mode gfm overrides)
apex document.md --mode unified --mode gfmapex post.md --standalone --title "My Blog Post" --style blog.css --pretty -o post.htmlapex README.md --mode gfm --pretty > README.htmlapex docs.md --standalone --title "Documentation" --id-format mmd --pretty# Show all changes
apex draft.md
# Apply all changes (final version)
apex draft.md --accept
# Revert all changes (original version)
apex draft.md --reject- Modes - How modes affect available options
- Header IDs - Header ID generation options
- Usage - Basic usage examples
Copyright 2025 Brett Terpstra, All Rights Reserved | MIT License
- Getting Started - Your first steps with Apex
- Installation - How to build and install Apex
- Usage - Basic usage examples
- Syntax - Complete syntax reference for unified mode
- Modes - Understanding processor modes
- Command Line Options - All CLI flags explained
- Header IDs - How header IDs are generated
- C API - Programmatic API documentation
- Xcode Integration - Using Apex in Xcode projects
- Examples - Practical usage examples
- Troubleshooting - Common issues and solutions
- Credits - Acknowledgments and links to related projects