Table of contents
- Indented Paragraphs (Quotes)
- Bulleted and Numbered Lists
- Horizontal Line
- Emphasis
- References
- Headings
Introduction ============
These are the PmWiki Markdown syntax rules. For sake of forward compatibility, this page does not discuss PmWiki markup.
Indented Paragraphs (Quotes) ========================================================
Markdown uses email-style > characters for blockquoting. If you’re familiar with quoting passages of text in an email message, then you know how to create a blockquote in Markdown. It looks best if you hard wrap the text and put a > before every line, but it is not required:
> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
> consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
> Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
>
> > Cras odio erat, iaculis ac, facilisis nec, rhoncus a, nisi.
> > Cras massa sapien, posuere nec, ultrices vitae, suscipit et, leo.
> > Proin malesuada, sapien ultricies ornare varius, libero justo
>
> Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse
> id sem consectetuer libero luctus adipiscing.
A bit of regular, unblockquoted text.
> This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet,
consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus.
Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, > consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. > Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus. > > > Cras odio erat, iaculis ac, facilisis nec, rhoncus a, nisi. > > Cras massa sapien, posuere nec, ultrices vitae, suscipit et, leo. > > Proin malesuada, sapien ultricies ornare varius, libero justo > > Donec sit amet nisl. Aliquam semper ipsum sit amet velit. Suspendisse > id sem consectetuer libero luctus adipiscing.
A bit of regular, unblockquoted text.
This is a blockquote with two paragraphs. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aliquam hendrerit mi posuere lectus. Vestibulum enim wisi, viverra nec, fringilla in, laoreet vitae, risus.
Blockquotes can be nested (i.e. a blockquote-in-a-blockquote) by adding additional levels of >:
This feature is currently defective.
> This is the first level of quoting.
>
> > This is nested blockquote.
>
> Back to the first level.
This is the first level of quoting. > > > This is nested blockquote. > > Back to the first level.
Blockquotes can contain other Markdown elements, including headers, lists, and code blocks:
This feature is currently defective.
> This is a header.
> ================
>
> 1. This is the first list item.
> 2. This is the second list item.
>
> Here's some example code:
>
> return shell_exec("echo $input | $markdown_script");
This is a header. > ================ > > 1. This is the first list item. > 2. This is the second list item. > > Here's some example code: > > return shell_exec("echo $input | $markdown_script");
Bulleted and Numbered Lists ==============================================
Markdown supports ordered (numbered) and unordered (bulleted) lists, in both strict PmWiki and standard Markdown.
The loose list item feature is currently not supported.
Unordered Lists
Unordered lists use asterisks, pluses, and hyphens — interchangably — as list markers. PmWiki Markdown does not yet support loose lists.
* Duis commodo dignissim orci.
* Mauris leo.
* Nunc aliquam ligula ut tortor.
Curabitur mollis. Sed urna lacus, malesuada ultrices, malesuada ut,
adipiscing cursus, eros. Suspendisse nulla.
+ Etiam egestas.
+ Curabitur pede.
+ Praesent ullamcorper.
Sed urna lacus, malesuada ultrices, malesuada ut, adipiscing cursus, eros.
Nullam sagittis euismod eros.
- Duis commodo dignissim orci.
- Mauris leo.
- Nunc aliquam ligula ut tortor.
* Duis commodo dignissim orci.
* Mauris leo.
* Nunc aliquam ligula ut tortor.
Curabitur mollis. Sed urna lacus, malesuada ultrices, malesuada ut, adipiscing cursus, eros. Suspendisse nulla.
+ Etiam egestas.
+ Curabitur pede.
+ Praesent ullamcorper.
Sed urna lacus, malesuada ultrices, malesuada ut, adipiscing cursus, eros. Nullam sagittis euismod eros.
- Duis commodo dignissim orci.
- Mauris leo.
- Nunc aliquam ligula ut tortor.
Nested levels of lists may be created in Markdown by intenting each nested layer three spaces from the parent level, the use of asterisks, pluses, and hyphens is irrelevant, but shown here for emphasis.
* Duis commodo dignissim orci.
* Mauris leo.
+ Etiam egestas.
+ Curabitur pede.
- Duis commodo dignissim orci.
- Mauris leo.
+ Praesent ullamcorper.
* Nunc aliquam ligula ut tortor.
- Mauris leo.
- Nunc aliquam ligula ut tortor.
* Duis commodo dignissim orci.
* Mauris leo.
+ Etiam egestas.
+ Curabitur pede.
- Duis commodo dignissim orci.
- Mauris leo.
+ Praesent ullamcorper.
* Nunc aliquam ligula ut tortor.
- Mauris leo.
- Nunc aliquam ligula ut tortor.
To make lists look nice, you can wrap items with hanging indents. But, you can still be lazy provided the leading line is properly indented:
* Duis commodo dignissim orci. Quisque odio. Donec luctus, elit et
eleifend porttitor, nulla arcu rutrum risus, sed elementum elit ipsum ut
enim. Duis dui metus, hendrerit in, tincidunt nonummy, facilisis nonummy,
odio.
* Mauris leo. Quisque odio. Donec luctus, elit et
eleifend porttitor, nulla arcu rutrum risus, sed
elementum elit ipsum ut enim. Duis dui metus,
hendrerit in, tincidunt nonummy, facilisis nonummy, odio.
+ Etiam egestas. Proin imperdiet. Vivamus porttitor porta massa.
Sed faucibus mi et risus. Aliquam ornare dolor id urna.Proin
imperdiet.
+ Curabitur pede. Vivamus porttitor porta massa.
Sed faucibus mi et risus. Aliquam ornare dolor id urna. Vivamus
porttitor porta massa. Sed faucibus mi et risus. Aliquam ornare dolor id
urna.
* Duis commodo dignissim orci. Quisque odio. Donec luctus, elit et eleifend porttitor, nulla arcu rutrum risus, sed elementum elit ipsum ut enim. Duis dui metus, hendrerit in, tincidunt nonummy, facilisis nonummy, odio.
* Mauris leo. Quisque odio. Donec luctus, elit et
eleifend porttitor, nulla arcu rutrum risus, sed
elementum elit ipsum ut enim. Duis dui metus,
hendrerit in, tincidunt nonummy, facilisis nonummy, odio.
+ Etiam egestas. Proin imperdiet. Vivamus porttitor porta massa.
Sed faucibus mi et risus. Aliquam ornare dolor id urna.Proin imperdiet.
+ Curabitur pede. Vivamus porttitor porta massa.
Sed faucibus mi et risus. Aliquam ornare dolor id urna. Vivamus porttitor porta massa. Sed faucibus mi et risus. Aliquam ornare dolor id urna.
Ordered Lists
PmWiki Markdown supports both PmWiki ordered lists--with Markdown styled indentation; or Markdown syntax. This first example shows PmWiki markup with all the effects of indentation demonstrated from the last unordered example above.
# Duis commodo dignissim orci. Quisque odio. Donec luctus, elit et
eleifend porttitor, nulla arcu rutrum risus, sed elementum elit ipsum ut
enim. Duis dui metus, hendrerit in, tincidunt nonummy, facilisis nonummy,
odio.
# Mauris leo. Quisque odio. Donec luctus, elit et
eleifend porttitor, nulla arcu rutrum risus, sed
elementum elit ipsum ut enim. Duis dui metus,
hendrerit in, tincidunt nonummy, facilisis nonummy, odio.
# Etiam egestas. Proin imperdiet. Vivamus porttitor porta massa.
Sed faucibus mi et risus. Aliquam ornare dolor id urna.Proin
imperdiet.
# Curabitur pede. Vivamus porttitor porta massa.
Sed faucibus mi et risus. Aliquam ornare dolor id urna. Vivamus
porttitor porta massa. Sed faucibus mi et risus. Aliquam ornare dolor id
urna.
# Duis commodo dignissim orci. Quisque odio. Donec luctus, elit et eleifend porttitor, nulla arcu rutrum risus, sed elementum elit ipsum ut enim. Duis dui metus, hendrerit in, tincidunt nonummy, facilisis nonummy, odio.
# Mauris leo. Quisque odio. Donec luctus, elit et
eleifend porttitor, nulla arcu rutrum risus, sed
elementum elit ipsum ut enim. Duis dui metus,
hendrerit in, tincidunt nonummy, facilisis nonummy, odio.
# Etiam egestas. Proin imperdiet. Vivamus porttitor porta massa.
Sed faucibus mi et risus. Aliquam ornare dolor id urna.Proin imperdiet.
# Curabitur pede. Vivamus porttitor porta massa.
Sed faucibus mi et risus. Aliquam ornare dolor id urna. Vivamus porttitor porta massa. Sed faucibus mi et risus. Aliquam ornare dolor id urna.
Here is a quick, clean introduction to Markdown ordered list syntax. As you can see, the numbering order of the digits is not relevant to the count. In the future, I plan to reintroduce my way of allowing the author to set the number.
1. Mauris leo. Quisque odio.
5. Etiam egestas. Proin imperdiet.
3. Mauris leo. Quisque odio.
1. Curabitur pede. Vivamus porttitor porta massa.
5. Etiam egestas. Proin imperdiet.
14. Duis commodo dignissim orci. Quisque odio.
2. Curabitur pede. Vivamus porttitor porta massa.
4. Duis commodo dignissim orci. Quisque odio.
3. Mauris leo. Quisque odio.
5. Etiam egestas. Proin imperdiet.
1. Curabitur pede. Vivamus porttitor porta massa.
1. Mauris leo. Quisque odio.
5. Etiam egestas. Proin imperdiet.
3. Mauris leo. Quisque odio.
1. Curabitur pede. Vivamus porttitor porta massa.
5. Etiam egestas. Proin imperdiet.
14. Duis commodo dignissim orci. Quisque odio.
2. Curabitur pede. Vivamus porttitor porta massa.
4. Duis commodo dignissim orci. Quisque odio.
3. Mauris leo. Quisque odio.
5. Etiam egestas. Proin imperdiet.
1. Curabitur pede. Vivamus porttitor porta massa.
Horizontal Line ==================================
You can produce a horizontal rule tag (
) by placing three or more hyphens or asterisks on a line by themselves. If you wish, you may use spaces between the hyphens or asterisks. Each of the following lines will produce a horizontal rule:
* * *
***
*****
- - -
---------------------------------------
-
* *
*
- - -
Emphasis ======================
-
Enclose text in a single asterisk or underline (*text* or _text_) for emphasis (usually italics)
-
Enclose text in a double asterisks or underlines (**text** or __text__) for strong emphasis (usually __bold__)
-
Enclose text in a single asterisk or underline (*\*text** or _\_text___) for some other kind of emphasis (usually ___bold italics__)
-
Emphasis can be used multiple times within a line, but cannot span across markup line boundaries (i.e., you can't put a paragraph break in the middle of bold text).
Neque porro quisquam est emphasis underlined qui dolorem emphasis
astericked ipsum quia dolor sit amet, strong emphasis underlined
consectetur, adipisci strong emphasis astericked velit. Lorem ipsum
dolor sit amet, consectetuer adipiscing elit. Very strong emphasis
underlined qui dolorem and very strong emphasis astericked
Neque porro quisquam est _emphasis underlined_ qui dolorem *emphasis astericked* ipsum quia dolor sit amet, __strong emphasis underlined__ consectetur, adipisci **strong emphasis astericked** velit. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. __Very strong emphasis underlined__ qui dolorem and *\*very strong emphasis astericked**
You may also want to review standard PmWiki Emphasis markup. It is worth mentioning that PmWiki's emphasis supports Grutatxt, which in turn supports traditional WikiWikiWeb markup.
References ==========================
PmWiki Markdown uses both PmWiki references and Markdown references. This allows PmWiki pages to easily link to one another and preserves PmWiki sites integrating Markdown. Additionally, PmWiki Markdown supports standard Markdown link styles, where the link text is delimited by [square brackets].
To create an inline link, use a set of regular parentheses immediately after the link text’s closing square bracket. Inside the parentheses, put the URL where you want the link to point, along with an optional title for the link, surrounded in quotes.
This is [an example](http://example.com/ "Title") inline link.
[This link](http://example.net/) has no title attribute.
This is [an example](http://example.com/ "Title") inline link.
[This link](http://example.net/) has no title attribute.
If you’re referring to a local resource on the same server, you can use relative paths:
See my [PmWiki Markdown](/Markdown/) page for details.
See my [PmWiki Markdown](/Markdown/) page for details.
Reference-style links use a second set of square brackets, inside which you place a label of your choosing to identify the link. You can optionally use a space to separate the sets of brackets. Then, anywhere in the document, you define your link label like this, on a line by itself:
Neque porro quisquam est qui dolorem ipsum quia dolor sit amet,
consectetur, adipisci velit. This is [an example][id] reference-style link.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Neque porro quisquam est qui dolorem ipsum quia dolor sit amet,
consectetur, adipisci velit. This is [an example] [id] reference-style
link. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
[id]: http://example.com/ "Optional Title Here"
Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit. This is [an example][id] reference-style link. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit. This is [an example] [id] reference-style link. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Headings ======================
Standard Markdown supports two styles of headings: Setext (which is Grutatext) and ATX. However, because PmWiki relies upon leading '#' to denote ordered lists, PmWiki Markdown fully supports only Setext (Grutatxt) and PmWiki headingss. It does not support ATX headings fully. While Markdown only supports two levels of Setext headings, PmWiki Markdown supports three, which should cover most your heading needs.
-
Atx-Style Headings** With a slight caveat, Atx-styled headings are supported. Because PmWiki Markdown cooperates with PmWiki markup, and because PmWiki markup uses leading pound symbols ("#"), Atx headings are supported provided the heading is flanked by '#' as you would do for emphasized text. However, you should not have to use the same number of trailing pound symbols as you do to denote the heading level.
Test Atx Heading 2##
Bunch of text.
Atx Heading 3
- Test Atx Heading 2##
Bunch of text.
- Atx Heading 3 #
-
Setext-style Section Headings** are “underlined” using equal signs (=) for first level, or section headings.
Section Heading
Neque porro quisquam est qui dolorem ipsum quia dolor sit amet,
consectetur, adipisci velit. Lorem ipsum dolor sit amet, consectetuer
adipiscing elit.
Section Heading ===============
Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
-
Setext-style Subsection Headings** are “underlined” using dashes (-) signs for second level, or subsection headings.
Subsection Heading
Neque porro quisquam est qui dolorem ipsum quia dolor sit amet,
consectetur, adipisci velit. Lorem ipsum dolor sit amet, consectetuer
adipiscing elit.
Subsection Heading
Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
-
Setext-style Sub-Subsection Headings** are “underlined” using tildas (~) for third level, or sub-subsection headings.
Sub-Sub-Section Heading
Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Sub-Sub-Section Heading ~~~~~~~~~~~~~~~~~~~~~~~
Neque porro quisquam est qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit. Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
There are three variables that manage the Setext-style headings that may be redefined by the site administrator, listed below. Because PmWiki Markdown supports PmWiki headings, internally these three variables return the PmWiki heading level (on exclamation mark (!) for each level of heading). Because the historical standard was that the page title was the
, these headings return through . Typically, a web page rarely carries more than three levels of headings. Therefore, these should match most needs. For level and , I recommend PmWiki headings.
* $MarkdownSectionLevel Creates <h2> for === sections.
* $MarkdownSubSectionLevel Creates <h3> for --- sections.
* $MarkdownSubSubSectionLevel Creates <h4> for ~~ sections.
. Typically, a web page rarely carries more than three levels of headings. Therefore, these should match most needs. For level and , I recommend PmWiki headings.
* $MarkdownSectionLevel Creates <h2> for === sections.
* $MarkdownSubSectionLevel Creates <h3> for --- sections.
* $MarkdownSubSubSectionLevel Creates <h4> for ~~ sections.
, I recommend PmWiki headings.
* $MarkdownSectionLevel Creates <h2> for === sections.
* $MarkdownSubSectionLevel Creates <h3> for --- sections.
* $MarkdownSubSubSectionLevel Creates <h4> for ~~ sections.
* $MarkdownSectionLevel Creates <h2> for === sections.
* $MarkdownSubSectionLevel Creates <h3> for --- sections.
* $MarkdownSubSubSectionLevel Creates <h4> for ~~ sections.