markdown.1 4 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14
.\"     %A%
.\"
.Dd January 7, 2008
.Dt MARKDOWN 1
.Os MASTODON
.Sh NAME
.Nm markdown
.Nd text to html conversion tool
.Sh SYNOPSIS
.Nm
.Op Fl d
.Op Fl T
.Op Fl V
.Op Fl b Ar url-base
15
.Op Fl C Ar prefix
16 17
.Op Fl F Pa bitmap
.Op Fl f Ar flags
18
.Op Fl n
19
.Op Fl o Pa file
20
.Op Fl S
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
.Op Fl s Pa text
.Op Fl t Pa text
.Op Pa textfile
.Sh DESCRIPTION
The
.Nm
utility reads the
.Xr markdown 7 Ns -formatted
.Pa textfile
.Pq or stdin if not specified,
compiles it, and writes the html output
to stdout.
.Pp
The options are as follows:
.Bl -tag -width "-o file"
.It Fl b Ar url-base
37
Links in source beginning with / will be prefixed with
38 39
.Ar url-base
in the output.
40 41 42 43
.It Fl C
When processing markdown extra-style footnotes, use the
given prefix instead of the default of
.Ar fn .
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
.It Fl d
Instead of writing the html file, dump a parse
tree to stdout.
.It Fl f Ar flags
Set or clear various translation flags.   The flags
are in a comma-delimited list, with an optional
.Ar +
(enable),
.Ar -
(disable), or
.Ar no
(disable) lprefix on each flag.
.Bl -tag -width "definitionlist"
.It Ar links
Allow links.
.It Ar image
Allow images.
.It Ar smarty
Enable smartypants.
.It Ar pants
Enable smartypants.
.It Ar html
Allow raw html.
.It Ar strict
Disable superscript, strikethrough & relaxed emphasis.
.It Ar ext
Enable pseudo-protocols.
.It Ar cdata
Generate code for xml 
.Em ![CDATA[...]] .
.It Ar superscript
Enable superscript processing.
.It Ar emphasis
Emphasis happens 
.Em everywhere .
.It Ar tables
Don't process PHP Markdown Extra tables.
.It Ar del
Enable
.Em ~~strikethrough~~ .
.It Ar strikethrough
Enable 
.Em ~~strikethrough~~ .
.It Ar toc
Enable table-of-contents processing.
.It Ar 1.0
Compatibility with MarkdownTest_1.0
.It Ar autolink
Make
.Pa http://foo.com
a link even without
.Em <> .
.It Ar safelink
Paranoid check for link protocol.
.It Ar header
Process pandoc-style header blocks.
.It Ar tabstop
Expand tabs to 4 spaces.
.It Ar divquote
Allow
.Pa >%class%
blocks.
.It Ar alphalist
Allow alphabetic lists.
.It Ar definitionlist
109 110 111 112 113 114 115 116 117
Allow definition lists at all (default). Use
.Em dldiscount
and
.Em dlextra
to control which syntaxes are respected.
.It Ar dldiscount
Enable discount-style definition lists (default).
.It Ar dlextra
Enable extra-style definition lists (not default). Both styles may be enabled simultaneously.
118 119
.It Ar footnote
Allow markdown extra-style footnotes.
120
.It Ar style
121
Extract <style> blocks from the output.
122 123 124 125 126 127 128 129
.It Ar fencedcode
Allow fenced code blocks (not default).
.It Ar idanchor
Use id= anchors for table-of-contents links instead of <a name=/> (not default).
.It Ar githubtags
Allow underscore and dash in passed through element names (not default).
.It Ar urlencodedanchor
Use url-encoded chars for multibyte and nonalphanumeric chars rather than dots in toc links.
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
.El
.Pp
As an example, the option
.Fl f Ar nolinks,smarty
tells
.Nm
to not allow \<a tags, and to do smarty
pants processing.
.It Fl F Ar bitmap
Set translation flags.
.Ar Bitmap
is a bit map of the various configuration options
described in
.Xr markdown 3 
(the flag values are defined in
.Pa mkdio.h )
146 147 148 149 150 151 152
.It Fl n
Don't write generated html.
.It Fl o Pa file
Write the generated html to 
.Pa file .
.It Fl S
output <style> blocks.
153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194
.It Fl V
Show the version# and compile-time configuration data.
.Pp
If the version includes the string
.Em DEBUG ,
.Nm
was configured with memory allocation debugging.
.Pp
If the version includes the string
.Em TAB ,
.Nm
was configured to use the specified tabstop.
.It Fl VV
Show the version#, the compile-time configuration, and the
run-time configuration.
.It Fl t Ar text
Use
.Xr mkd_text 3
to format 
.Ar text
instead of processing stdin with the
.Xr markdown 3
function.
.It Fl T
If run with the table-of-content flag on, dump the
table of contents before the formatted text.
.It Fl s Ar text
Use the
.Xr markdown 3
function to format
.Ar text .
.El
.Sh RETURN VALUES
The
.Nm
utility exits 0 on success, and >0 if an error occurs.
.Sh SEE ALSO
.Xr markdown 3 ,
.Xr markdown 7 ,
.Xr mkd-extensions 7 .
.Sh AUTHOR
.An David Parsons
195
.Pq Li orc@pell.portland.or.us