Skip to content

Command line options

step- edited this page Jan 27, 2025 · 3 revisions
Usage:     mdview [OPTIONS] HOMEPATH [HOMEPAGE [TITLE]]

Press [F1] in the GUI viewer to open the Welcome Page and get more help. 
HOMEPATH is the file or directory to open. HOMEPAGE is the file to open if 
HOMEPATH is a directory. If HOMEPAGE is empty, "index.md" is used instead. 
If TITLE is empty, "mdview" is used for the window title. 
In Markdown, relative paths are based on the directory of the currently viewed 
file. If this fails, the directory of the HOMEPAGE file is used.

OUTPUT FORMATS

If an output format is not specified the file is opened in the GUI viewer. 
Some formats can be tweaked (see section OUTPUT MODIFIERS).

  --ansi              Text with ANSI escape codes. 
  --bare              Plain text with most Markdown formatting removed. 
  --html              HTML fragment. 
  --text              Decorated text. 
  --tty               Text with vt100 codes.

OUTPUT MODIFIERS

  --cm-block-end      Add an empty line at code block end. 
  --html-base=[DIR]   Use DIR instead of HOMEPATH for the <base> tag. 
                      Leave DIR empty to omit <base> tag and javascript. 
  --html-css=NUM      Embed CSS style sheet NUM in 0..2; default 0 but in the 
                      Viewer it is NUM=2 for HTML Preview. Implies --html-full. 
  --html-full         Render a full HTML document, with a <base> tag to set 
                      relative links to HOMEPATH, and javascript to assist 
                      internal links. See also the --html-base option. 
  --html5             Output HTML5 rather than XHTML. 
  --output=FILE       Redirect output to file FILE. 
  --soft-break        Render line endings within input paragraphs as new lines 
                      instead of joining input lines together. 
                      Soft breaks can inhibit some smart text replacements. 
  --soft-break-br     Append a hard break after a soft break in HTML output. 
  --unsafe-html       Include raw HTML in all output formats.

EXTENSIONS

  --auto-lang         If a link points to "F.ext", and "F.$LANG.ext" exists, 
                      open the latter. This feature requires the Viewer. 
  --no-auto-code      Disable rendering certain plain words as code spans. 
  --no-extensions     Disable all extensions. 
  --no-heading-link   Do not add heading anchors. This feature requires either 
                      Viewer or HTML output. 
  --no-permlink       Disable permissive auto-links. 
  --no-shebang        Disable file shebang detection. 
  --no-smart          Disable smart text replacements. 
  --no-strikethrough  Disable support for striking text. 
  --no-table          Disable support for Markdown tables. 
  --toc-level=LEVEL   Replace the first occurrence of "<!--[toc]-->" with 
                      the Table of Contents. If the pattern is missing, place 
                      the ToC at the top. LEVEL in 0..6. This feature requires 
                      heading link anchors, and either Viewer or HTML output.

MISCELLANEOUS

  --dump-css=NUM      Output CSS style-sheet NUM and exit. 
  -h, --help          Print this help page and exit. 
  --license           Print the program license and exit. 
  --lint              Enable the linter; needs either Viewer or HTML output. 
  --version           Print the program version and exit.

ENVIRONMENT

Program options can also be set using the environment variable MDVIEW_OPTIONS. 
A command-line option will override any option with the same name set through 
this variable. However, if MDVIEW_OPTIONS specifies HOMEPATH, HOMEPAGE, or 
TITLE, these values will take precedence over their command-line counterparts.

Clone this wiki locally