markdown.1 4.0 KB

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