Markdown syntax: Difference between revisions
From wikinotes
(14 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
These notes are based on the base markdown spec.<br> | These notes are based on the base markdown spec. Ideally, this should be supported by all parsers.<br> | ||
Parsers may introduce additional features. | Parsers may introduce additional features. | ||
Line 16: | Line 16: | ||
<blockquote> | <blockquote> | ||
Headers can be defined using hash prefix, or underlines. | Headers can be defined using hash prefix, or underlines. | ||
< | <pre> | ||
# Header 1 | # Header 1 | ||
## Header 2 | ## Header 2 | ||
Line 26: | Line 26: | ||
Header 2 | Header 2 | ||
-------- | -------- | ||
</ | </pre> | ||
For underlines, the character matters | For underlines, the character matters | ||
Line 32: | Line 32: | ||
* <code>-</code> for header-2 | * <code>-</code> for header-2 | ||
</blockquote><!-- Headers --> | </blockquote><!-- Headers --> | ||
== Text Formatting == | |||
<blockquote> | |||
<syntaxhighlight lang="md"> | |||
*emphasize txt* _emphasize txt_ # <em> | |||
**strong txt** __strong txt__ # <strong> | |||
</syntaxhighlight> | |||
</blockquote><!-- Text Formatting --> | |||
== Links == | == Links == | ||
<blockquote> | <blockquote> | ||
Automatic Links | |||
<syntaxhighlight lang="md"> | |||
<https://wikipedia.com> | |||
</syntaxhighlight> | |||
External Links | |||
<syntaxhighlight lang="md"> | |||
See [wikipedia article](https://en.wikipedia.org/wiki/Markdown). | |||
</syntaxhighlight> | |||
Relative Links | |||
<syntaxhighlight lang="md"> | |||
See [other page](samesite/page) | |||
</syntaxhighlight> | |||
Cross-References (same-page links) | Cross-References (same-page links) | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="md"> | ||
See [Official Docs][docs] | See [Official Docs][docs] | ||
Line 43: | Line 65: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
</blockquote><!-- Links --> | </blockquote><!-- Links --> | ||
== Blockquotes == | |||
<blockquote> | |||
<syntaxhighlight lang="md"> | |||
a regular paragraph | |||
> an indented | |||
> paragraph | |||
> | |||
> > a double-indented paragraph | |||
</syntaxhighlight> | |||
</blockquote><!-- Blockquotes --> | |||
== Images == | |||
<blockquote> | |||
<syntaxhighlight lang="md"> | |||
![kittens](/path/to/kittens.png) | |||
</syntaxhighlight> | |||
</blockquote><!-- Images --> | |||
== Code == | |||
<blockquote> | |||
Newline+Indented text is put in a <code>pre</code> block. | |||
<syntaxhighlight lang="md"> | |||
Checkout this function | |||
def foo(bar): | |||
print("baz") | |||
</syntaxhighlight> | |||
Inline code is entered between <code>`</code>s. | |||
<syntaxhighlight lang="md"> | |||
The `def` here is foo. | |||
</syntaxhighlight> | |||
</blockquote><!-- Code --> | |||
== Lists == | == Lists == | ||
Line 49: | Line 106: | ||
<blockquote> | <blockquote> | ||
Unordered lists can be defined with <code>*</code>, <code>+</code>, or <code>-</code>. | Unordered lists can be defined with <code>*</code>, <code>+</code>, or <code>-</code>. | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="md"> | ||
* red | * red | ||
+ yellow | + yellow | ||
Line 56: | Line 113: | ||
Ordered lists use numbers with periods. | Ordered lists use numbers with periods. | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="md"> | ||
1. one | 1. one | ||
2. two | 2. two | ||
Line 65: | Line 122: | ||
=== List Items === | === List Items === | ||
<blockquote> | <blockquote> | ||
<syntaxhighlight lang=" | Long list-items with hanging indents | ||
<syntaxhighlight lang="md"> | |||
* a very long list item, | * a very long list item, | ||
separated across multiple | separated across multiple | ||
lines | lines | ||
</syntaxhighlight> | |||
Items containing quotes | |||
<syntaxhighlight lang="md"> | |||
* then vader says | |||
> I am altering the deal, | |||
> pray I don't alter it again | |||
</syntaxhighlight> | |||
Items contianing code (indented by 8-spaces) | |||
<syntaxhighlight lang="md"> | |||
* check out this function | |||
def foo(bar): | |||
print("baz") | |||
</syntaxhighlight> | </syntaxhighlight> | ||
</blockquote><!-- List Items --> | </blockquote><!-- List Items --> | ||
</blockquote><!-- Lists --> | </blockquote><!-- Lists --> | ||
</blockquote><!-- Syntax --> | </blockquote><!-- Syntax --> |
Latest revision as of 13:56, 19 September 2021
These notes are based on the base markdown spec. Ideally, this should be supported by all parsers.
Parsers may introduce additional features.
Documentation
official docs https://daringfireball.net/projects/markdown/syntax
Syntax
Headers
Headers can be defined using hash prefix, or underlines.
# Header 1 ## Header 2 ### Header 3 Header 1 ======== Header 2 --------For underlines, the character matters
=
for header-1-
for header-2Text Formatting
*emphasize txt* _emphasize txt_ # <em> **strong txt** __strong txt__ # <strong>Links
Automatic Links
<https://wikipedia.com>External Links
See [wikipedia article](https://en.wikipedia.org/wiki/Markdown).Relative Links
See [other page](samesite/page)Cross-References (same-page links)
See [Official Docs][docs] ## Official Documentation [docs]Blockquotes
a regular paragraph > an indented > paragraph > > > a double-indented paragraphImages
![kittens](/path/to/kittens.png)Code
Newline+Indented text is put in a
pre
block.Checkout this function def foo(bar): print("baz")Inline code is entered between
`
s.The `def` here is foo.
Lists
List Types
Unordered lists can be defined with
*
,+
, or-
.* red + yellow - blueOrdered lists use numbers with periods.
1. one 2. two 3. threeList Items
Long list-items with hanging indents
* a very long list item, separated across multiple linesItems containing quotes
* then vader says > I am altering the deal, > pray I don't alter it againItems contianing code (indented by 8-spaces)
* check out this function def foo(bar): print("baz")