markdown1
Text to html conversion tool
Usage
markdown [-d]
[-T]
[-V]
[-b
url-base]
[-C
prefix]
[-F
bitmap]
[-f
flags]
[-n]
[-o
file]
[-S]
[-s
text]
[-t
text]
[-toc]
[textfile]
Overview
The markdown utility reads the markdown(7)-formatted textfile (or stdin if not specified,) compiles it, and writes the html output to stdout.
The options are as follows:
-
-b url-base -
Links in source beginning with / will be prefixed with url-base in the output.
-
-C -
When processing markdown extra-style footnotes, use the given prefix instead of the default of fn.
-
-d -
Instead of writing the html file, dump a parse tree to stdout.
-
-f flags -
Set or clear various translation flags. The flags are in a comma-delimited list, with an optional + (enable), - (disable), or no (disable) lprefix on each flag.
- links
-
Allow links.
- image
-
Allow images.
- smarty
-
Enable smartypants.
- pants
-
Enable smartypants.
- html
-
Allow raw html.
- strict
-
Disable superscript, strikethrough & relaxed emphasis.
- ext
-
Enable pseudo-protocols.
- cdata
-
Generate code for xml ![CDATA[...]].
- superscript
-
Enable superscript processing.
- emphasis
-
Emphasis happens everywhere.
- tables
-
Don't process PHP Markdown Extra tables.
- del
-
Enable ~~strikethrough~~.
- strikethrough
-
Enable ~~strikethrough~~.
- toc
-
Enable table-of-contents processing.
- 1.0
-
Compatibility with MarkdownTest_1.0
- autolink
-
Make http://foo.com a link even without <>.
- safelink
-
Paranoid check for link protocol.
- header
-
Process pandoc-style header blocks.
- tabstop
-
Expand tabs to 4 spaces.
- divquote
-
Allow >%class% blocks.
- alphalist
-
Allow alphabetic lists.
- definitionlist
-
Allow definition lists at all (default). Use dldiscount and dlextra to control which syntaxes are respected.
- dldiscount
-
Enable discount-style definition lists (default).
- dlextra
-
Enable extra-style definition lists (not default). Both styles may be enabled simultaneously.
- footnote
-
Allow markdown extra-style footnotes.
- style
-
Extract <style> blocks from the output.
- fencedcode
-
Allow fenced code blocks (not default).
- idanchor
-
Use id= anchors for table-of-contents links instead of <a name=/> (not default).
- githubtags
-
Allow underscore and dash in passed through element names (not default).
- urlencodedanchor
-
Use url-encoded chars for multibyte and nonalphanumeric chars rather than dots in toc links.
As an example, the option
-fnolinks,smarty tellsmarkdownto not allow <a tags, and to do smarty pants processing.
-
-F bitmap -
Set translation flags. Bitmap is a bit map of the various configuration options described in markdown(3) (the flag values are defined in mkdio.h)
-
-n -
Don't write generated html.
-
-o file -
Write the generated html to file.
-
-S -
output <style> blocks.
-
-V -
Show the version# and compile-time configuration data.
If the version includes the string DEBUG,
markdownwas configured with memory allocation debugging.If the version includes the string TAB,
markdownwas configured to use the specified tabstop. -
-VV -
Show the version#, the compile-time configuration, and the run-time configuration.
-
-t text -
Use mkd_text(3) to format text instead of processing stdin with the markdown(3) function.
-
-T -
If run with the table-of-content flag on, dump the table of contents before the formatted text.
-
-s text -
Use the markdown(3) function to format text.
-
-toc -
Set the table-of-content flag, then dump the table of contents before the formatted text (a shorthand for
--T--toc)
Return values
The markdown utility exits 0 on success, and >0 if an error occurs.
Releases
12 releases since Debian 3.1 (Sarge); the text changed 4 times.
-C since Debian 9 (Stretch);
-F since Debian 9 (Stretch);
-S since Debian 9 (Stretch);
-T since Debian 9 (Stretch);
-V since Debian 9 (Stretch);
-VV since Debian 9 (Stretch);
-b since Debian 9 (Stretch);
-d since Debian 9 (Stretch);
-f since Debian 9 (Stretch);
-n since Debian 9 (Stretch);
-o since Debian 9 (Stretch);
-t since Debian 9 (Stretch);
-toc since Arch Linux 2026-11-01.
--html4tags until Debian 8 (Jessie);
--shortversion until Debian 8 (Jessie);
--version until Debian 8 (Jessie);
-v until Debian 8 (Jessie).