Warning, /education/cantor/thirdparty/discount-2.2.6-patched/Plan9/markdown.6 is written in an unsupported language. File is not indexed.

0001 .TH MARKDOWN 6
0002 .SH NAME
0003 Markdown \- text formatting syntax
0004 .SH DESCRIPTION
0005 Markdown
0006 is a text markup syntax for machine conversion to
0007 the more complex
0008 .SM HTML
0009 or
0010 .SM XHTML
0011 markup languages.
0012 It is intended to be easy to read and to write, with
0013 emphasis on readability.
0014 A Markdown-formatted document should be publishable as-is,
0015 in plain text, without the formatting distracting the reader.
0016 .PP
0017 The biggest source of inspiration for Markdown's
0018 syntax is the format of plain text email.  The markup is comprised entirely
0019 of punctuation characters, chosen so as to look like what they mean.
0020 Asterisks around a word look like
0021 .IR *emphasis* .
0022 Markdown lists look like lists.  Even
0023 blockquotes look like quoted passages of text, assuming the reader has
0024 used email.
0025 .PP
0026 .SS Block Elements
0027 .TF W
0028 .PD
0029 .TP
0030 Paragraphs and Line Breaks
0031 A paragraph is one or more consecutive lines of text, separated
0032 by one or more blank lines.  (A blank line is any line that looks like a
0033 blank line -- a line containing nothing but spaces or tabs is considered
0034 blank.) Normal paragraphs should not be indented with spaces or tabs.
0035 .IP
0036 Lines may be freely broken for readability; Markdown
0037 does not translate source line breaks to
0038 .B <br />
0039 tags.  To request generation of
0040 .B <br />
0041 in the output, end a line with two or more spaces, then a newline.
0042 .TP
0043 Headings
0044 Headings can be marked in two ways, called
0045 .I setext
0046 and
0047 .IR atx .
0048 .IP
0049 Setext-style headings are
0050 ``underlined'' using equal signs (for first-level
0051 headings) and dashes (for second-level headings).
0052 .IP
0053 Atx-style headings use 1-6 hash characters at the start of the line,
0054 corresponding to
0055 .SM HTML
0056 .BR <h^(1-6)^> .
0057 Optional closing hashes may follow
0058 the heading text.
0059 .TP
0060 Blockquotes
0061 Lines beginning with
0062 .B >
0063 are output in blockquotes.
0064 Blockquotes can be nested
0065 by multiple levels of
0066 .BR >> .
0067 Blockquotes can contain other Markdown elements, including
0068 headings, lists, and code blocks.
0069 .TP
0070 Lists
0071 Markdown supports ordered (numbered) and unordered (bulleted) lists.
0072 List markers typically start at the left margin, but may be indented by
0073 up to three spaces.
0074 List markers must be followed by one or more spaces
0075 or a tab, then the list item text.
0076 A newline terminates each list item.
0077 .IP
0078 Unordered lists use asterisks, pluses, and hyphens interchangeably as
0079 list markers.
0080 .IP
0081 Ordered lists use integers followed by periods as list markers.
0082 The order of the integers is not interpreted,
0083 but the list should begin with
0084 .BR 1 .
0085 .IP
0086 If list items are separated by blank lines, Markdown will wrap each list
0087 item in
0088 .B <p>
0089 tags in the
0090 .SM HTML
0091 output.
0092 .IP
0093 List items may consist of multiple paragraphs.
0094 Each subsequent
0095 paragraph within a list item must be indented by either 4 spaces
0096 or one tab.
0097 To put a blockquote within a list item, the blockquote's
0098 .B >
0099 marker needs to be indented.
0100 To put a code block within a list item, the code block needs
0101 to be indented
0102 .I twice
0103 -- 8 spaces or two tabs.
0104 .TP
0105 Code Blocks
0106 To produce a code block, indent every line of the
0107 block by at least 4 spaces or 1 tab.
0108 A code block continues until it reaches a line that is not indented.
0109 .IP
0110 Rather than forming normal paragraphs, the lines
0111 of a code block are interpreted literally.
0112 Regular Markdown syntax is not processed within code blocks.
0113 Markdown wraps a code block in both
0114 .B <pre>
0115 and
0116 .B <code>
0117 tags.
0118 One level of indentation -- 4
0119 spaces or 1 tab -- is removed from each line of the code block in
0120 the output.
0121 .TP
0122 Horizontal Rules
0123 Produce a horizontal rule tag
0124 .RB ( <hr\ /> )
0125 by placing three or
0126 more hyphens, asterisks, or underscores on a line by themselves.
0127 .SS Span Elements
0128 .TF W
0129 .PD
0130 .TP
0131 Links
0132 Markdown supports two styles of links:
0133 .I inline
0134 and
0135 .IR reference .
0136 In both styles, the link text is delimited by square brackets
0137 .RB ( [] ).
0138 To create an inline link, use a set of regular parentheses immediately
0139 after the link text's closing square bracket.
0140 Inside the parentheses,
0141 put the link URL, along with an optional
0142 title for the link surrounded in double quotes.
0143 For example:
0144 .IP
0145 .EX
0146         An [example](http://example.com/ "Title") inline link.
0147 .EE
0148 .IP
0149 Reference-style links use a second set of square brackets, inside
0150 which you place a label of your choosing to identify the link:
0151 .IP
0152 .EX
0153         An [example][id] reference-style link.
0154 .EE
0155 .IP
0156 The label is then assigned a value on its own line, anywhere in the document:
0157 .IP
0158 .EX
0159         [id]: http://example.com/  "Optional Title"
0160 .EE
0161 .IP
0162 Link label names may consist of letters, numbers, spaces, and
0163 punctuation.
0164 Labels are not case sensitive.
0165 An empty label bracket
0166 set after a reference-style link implies the link label is equivalent to
0167 the link text.
0168 A URL value can then be assigned to the link by referencing
0169 the link text as the label name.
0170 .TP
0171 Emphasis
0172 Markdown treats asterisks
0173 .RB ( * )
0174 and underscores
0175 .RB ( _ )
0176 as indicators of emphasis.
0177 Text surrounded with single asterisks or underscores
0178 will be wrapped with an
0179 .SM HTML
0180 .B <em>
0181 tag.
0182 Double asterisks or underscores generate an
0183 .SM HTML
0184 .B <strong>
0185 tag.
0186 .TP
0187 Code
0188 To indicate a span of code, wrap it with backtick quotes
0189 .RB ( ` ).
0190 Unlike a code block, a code span indicates code within a
0191 normal paragraph.
0192 To include a literal backtick character within a code span, you can use
0193 multiple backticks as the opening and closing delimiters:
0194 .IP
0195 .EX
0196         ``There is a literal backtick (`) here.``
0197 .EE
0198 .TP
0199 Images
0200 Markdown image syntax is intended to resemble that
0201 for links, allowing for two styles, once again
0202 .I inline
0203 and
0204 .IR reference .
0205 The syntax is as for each respective style of link, described above, but
0206 prefixed with an exclamation mark character
0207 .RB ( ! ).
0208 Inline image syntax looks like this:
0209 .IP
0210 .EX
0211         ![Alt text](/path/to/img.jpg "Optional title")
0212 .EE
0213 .IP
0214 That is:
0215 An exclamation mark;
0216 followed by a set of square brackets containing the `alt'
0217 attribute text for the image;
0218 followed by a set of parentheses containing the URL or path to
0219 the image, and an optional `title' attribute enclosed in double
0220 or single quotes.
0221 .IP
0222 Reference-style image syntax looks like this:
0223 .IP
0224 .EX
0225         ![Alt text][id]
0226 .EE
0227 .IP
0228 Where
0229 .I id
0230 is a label used as for reference-style URL links, described above.
0231 .SS Convenience
0232 .TF W
0233 .PD
0234 .TP
0235 Automatic Links
0236 There is a shortcut style for creating ``automatic''
0237 links for URLs and email addresses.
0238 Surround the URL
0239 or address with angle brackets.
0240 .TP
0241 Backslash Escapes
0242 Use backslash escapes to generate literal
0243 characters which would otherwise have special meaning in Markdown's
0244 formatting syntax.
0245 .TP
0246 Inline HTML
0247 For markup that is not covered by Markdown's
0248 syntax, simply use the
0249 .SM HTML
0250 directly.
0251 The only restrictions are that block-level
0252 .SM HTML
0253 elements -- 
0254 .BR <div> ,
0255 .BR <table> ,
0256 .BR <pre> ,
0257 .BR <p> ,
0258 etc. -- must be separated from surrounding
0259 content by blank lines, and the start and end tags of the block should
0260 not be indented with tabs or spaces. Markdown formatting syntax is
0261 not processed within block-level
0262 .SM HTML
0263 tags.
0264 .IP
0265 Span-level
0266 .SM HTML
0267 tags -- e.g. 
0268 .BR <span> ,
0269 .BR <cite> ,
0270 or
0271 .B <del>
0272 -- can be
0273 used anywhere in a Markdown
0274 paragraph, list item, or heading.
0275 It is permitted to use
0276 .SM HTML
0277 tags instead of Markdown formatting; e.g.
0278 .SM HTML 
0279 .B <a>
0280 or
0281 .B <img>
0282 tags instead of Markdown's
0283 link or image syntax.
0284 Unlike block-level
0285 .SM HTML
0286 tags, Markdown
0287 syntax
0288 .I is
0289 processed within the elements of span-level tags.
0290 .TP
0291 Automatic Special Character Escapes
0292 To be displayed literally in a user agent, the characters
0293 .B <
0294 and
0295 .B &
0296 must appear as escaped entities in
0297 .SM HTML
0298 source, e.g.
0299 .B &lt;
0300 and
0301 .BR &amp; .
0302 Markdown
0303 allows natural use of these characters, taking care of
0304 the necessary escaping.
0305 The ampersand part of a directly-used
0306 .SM HTML
0307 entity remains unchanged; otherwise it will be translated
0308 into
0309 .BR &amp; .
0310 Inside code spans and blocks, angle brackets and
0311 ampersands are always encoded automatically.
0312 This makes it easy to use Markdown to write about
0313 .SM HTML
0314 code.
0315 .PP
0316 .SS Smarty Pants
0317 The
0318 .IR markdown (1)
0319 utility transforms a few plain text symbols into their typographically-fancier
0320 .SM HTML
0321 entity equivalents.
0322 These are extensions to the standard Markdown syntax.
0323 .TF W
0324 .PD
0325 .TP
0326 Punctuation
0327 Input single- and double-quotes are transformed
0328 into ``curly'' quote entities in the output (e.g., 
0329 .B 'text'
0330 becomes
0331 .BR &lsquo;text&rsquo; ).
0332 Input double-dashes
0333 .RB ( -- )
0334 and triple-dashes become en- and em-dashes, respectively,
0335 while a series of three dots
0336 .RB ( ... )
0337 in the input becomes an ellipsis entity
0338 .RB ( &hellip; )
0339 in the
0340 .SM HTML
0341 output.
0342 .TP
0343 Symbols
0344 Three other transformations replace the common plain-text shorthands
0345 .BR (c) ,
0346 .BR (r) ,
0347 and
0348 .BR (tm)
0349 from the input with their respective
0350 .SM HTML
0351 entities. (As in
0352 .B (c)
0353 becoming
0354 .BR &copy; ,
0355 the Copyright symbol entity.)
0356 .TP
0357 Fractions
0358 A small set of plain-text shorthands for fractions is recognized.
0359 .B 1/4
0360 becomes
0361 .BR &frac14; ,
0362 for example. These fraction notations are replaced with their
0363 .SM HTML
0364 entity equivalents:
0365 .BR 1/4 ,
0366 .BR 1/2 ,
0367 .BR 3/4 .
0368 .B 1/4th
0369 and
0370 .B 3/4ths
0371 are replaced with their entity and the indicated ordinal suffix letters.
0372 .PP
0373 Like the basic Markdown syntax, none of the ``Smarty Pants'' extensions are processed
0374 inside code blocks or spans.
0375 .PP
0376 .SS Discount Extensions
0377 .IR Markdown (1)
0378 recognizes some extensions to the Markdown format,
0379 many of them adopted or adapted from other Markdown
0380 interpreters or document formatting systems.
0381 .TF W
0382 .PD
0383 .TP
0384 Pandoc Headers
0385 If
0386 .I markdown
0387 was configured with
0388 .BR --enable-pandoc-header ,
0389 the markdown source can have a 3-line Pandoc header in the format of
0390 .IP
0391 .EX
0392 % Title
0393 % Author
0394 % Date
0395 .EE
0396 .IP
0397 whose data is available to the
0398 .IR mkd_doc_title ,
0399 .IR mkd_doc_author ,
0400 and
0401 .I mkd_doc_date
0402 (in
0403 .IR markdown (2))
0404 functions.
0405 .TP
0406 Embedded Stylesheets
0407 Stylesheets may be defined and modified in a
0408 .B <style>
0409 block.   A style block is parsed like any other block-level
0410 .SM HTML;
0411 .B <style>
0412 starting on column 1, raw
0413 .SM HTML
0414 (or, in this case,
0415 .SM CSS \)
0416 following it, and either ending with a
0417 .B </style>
0418 at the end of the line or at the beginning of a subsequent line.
0419 .IP
0420 Style blocks apply to the entire document regardless of where they are defined.
0421 .TP
0422 Image Dimensions
0423 Image specification has been extended with an argument describing image dimensions:
0424 .BI = height x width.
0425 For an image 400 pixels high and 300 wide, the new syntax is:
0426 .IP
0427 .EX
0428         ![Alt text](/path/to/image.jpg =400x300 "Title")
0429 .EE
0430 .TP
0431 Pseudo-Protocols
0432 Pseudo-protocols that may replace the common
0433 .B http:
0434 or
0435 .B mailto:
0436 have been added to the link syntax described above.
0437 .IP
0438 .BR abbr :
0439 Text following is used as the
0440 .B title
0441 attribute of an
0442 .B abbr
0443 tag wrapping the link text. So
0444 .B [LT](abbr:Link Text)
0445 gives
0446 .B <abbr title="Link Text">LT</abbr>.
0447 .IP
0448 .BR id :
0449 The link text is marked up and written to the output, wrapped with
0450 .B <a id=text following>
0451 and
0452 .BR </a> .
0453 .IP
0454 .BR class :
0455  The link text is marked up and written to the output, wrapped with
0456 .B <span class=text following>
0457 and
0458 .BR </span> .
0459 .IP
0460 .BR raw :
0461 Text following is written to the output with no further processing.
0462 The link text is discarded.
0463 .TP
0464 Alphabetic Lists
0465 If
0466 .I markdown
0467 was configured with
0468 .BR --enable-alpha-list ,
0469 .IP
0470 .EX
0471 a. this
0472 b. is
0473 c. an alphabetic
0474 d. list
0475 .EE
0476 .IP
0477 yields an
0478 .SM HTML
0479 .B ol
0480 ordered list.
0481 .TP
0482 Definition Lists
0483 If configured with
0484 .BR --enable-dl-tag ,
0485 markup for definition lists is enabled.  A definition list item is defined as
0486 .IP
0487 .EX
0488 =term=
0489         definition
0490 .EE
0491 .TP
0492 Tables
0493 Tables are specified with a pipe
0494 .RB ( | )
0495 and dash
0496 .RB ( - )
0497 marking. The markdown text
0498 .IP
0499 .EX
0500 header0|header1
0501 -------|-------
0502   textA|textB
0503   textC|textD
0504 .EE
0505 .IP
0506 will produce an
0507 .SM HTML
0508 .B table
0509 of two columns and three rows.
0510 A header row is designated by ``underlining'' with dashes.
0511 Declare a column's alignment by affixing a colon
0512 .RB ( : )
0513 to the left or right end of the dashes underlining its header.
0514 In the output, this
0515 yields the corresponding value for the
0516 .B align
0517 attribute on each
0518 .B td
0519 cell in the column.
0520 A colon at both ends of a column's header dashes indicates center alignment.
0521 .TP
0522 Relaxed Emphasis
0523 The rules for emphasis are changed so that a single
0524 .B _
0525 will not count as an emphasis character in the middle of a word.
0526 This is useful for documenting some code where
0527 .B _
0528 appears frequently, and would normally require a backslash escape.
0529 .PD
0530 .SH SEE ALSO
0531 .IR markdown (1),
0532 .IR markdown (2)
0533 .PP
0534 http://daringfireball.net/projects/markdown/syntax/,
0535 ``Markdown: Syntax''.
0536 .PP
0537 http://daringfireball.net/projects/smartypants/,
0538 ``Smarty Pants''.
0539 .PP
0540 http://michelf.com/projects/php-markdown/extra/#table,
0541 ``PHP Markdown Extra: Tables''.