Warning:
This wiki has been archived and is now read-only.

Syntax

From Markdown Community Group
Jump to: navigation, search

Markdown Syntax.

Rather difficult to talk about when writing in a variety of markdown (mediawiki)


Basics

(For my definition of basic, I'm taking Markdown and little else)

A paragraph is separated by one or more newline characters. Is this contentious?


paragraphs

< 3 optional spaces, text, terminated by two newlines

Blank Lines

Currently a blank line followed by newline terminates the previous block element.

Headers

Heading level 1

===============

Heading level 2
---------------
With any number of underlines / equals signs
or (contentious?)
# heading 1
## heading 2
...
###### heading 6
optionally, the hashes may be 'matched' or closed as in
 ## level 2 ##


Lists

Unordered (bulleted) lists

* list item
* List item 

the + sign or - sign are alternatives to the * sign (Not basic? @FIXME) Note. Lazy continuations of single list items are treated especially in MD


Ordered lists

1. Item
1. Item
1. Item

Note that the number itself is immaterial for html output. Except (not basic? @FIXME) the first number must be 1. Note. No mention of sub-lists AFAICT? Note. Two line feeds between unordered list items causes a p element to be inserted (not basic? @FIXME)


Preformatted text

In MD, also called code blocks. Suggest we retain preformatted text since extensions deal with code blocks differently.

Indented, by four or more white space E.g.

____Content

Note that ALL white space is respected within this markdown, and that it is line based, i.e. terminates at the next line which is not indented by four or more spaces


Links

Inline links included. Reference links are in the optional section

 An example,  [hot text](externalUrl "alt text") of an inline link

E.g. [Example](http://example.com "alt text")

A local resource (on the same server) is given special treatment. Suggest this be made optional @FIXME


Fragment id's are not supported except via reference links. @FIXME Should this be basic? What of non-html targets?


Inline markup

Emphasis is shown using *emphasised text* or _emphasised text_ I.e. * or _ used for emphasis. @FIXME, single preference or allow both?

HTML strong is supported by doubling up, i.e. **strong text** or __strong text_

@FIXME Suggest that strong markup be moved to optional

Note: * or _ with white space either side is treated as a literal character, not markup. @FIXME, review?

inline code

Backtick, ` is used to delineate inline code, e.g. `printf()` function Note `` is used to produce literal backtick `

There are other aspects to this. See dariingfireball.net for details

Inline images

 ![Alt text](/path/to/img.jpg)
 which appears to support (html) internal images only. @FIXME, move to optional?

Backslash Escapes

Apart from inline code, the general mechanism would appear to be using \<char> i.e. backslash followed by a single typed character. This would appear to be a general mechanism which works, but ignores Unicode code points? @FIXME

Markdown provides escapes for the following

\   backslash
`   backtick
*   asterisk
_   underscore
{}  curly braces
[]  square brackets
()  parentheses
#   hash mark
+   plus sign
-   minus sign (hyphen)
.   dot
!   exclamation mark

Could this be generalised?

Optional Markdown @FIXME

blockquotes

> A blockquoted piece

> more blockquoted

Horizontal Rules

* * *

or

***

or

 ****

or

- - - 

or

 -----------------------

@FIXME too many options?

Should be only one for core profile. Paul E. Merrell 03:36, 27 November 2012 (UTC)


back to Main_Page