For GitLab we developed something we call "GitLab Flavored Markdown" (GFM). It extends the standard Markdown in a few significant ways to add some useful functionality.
For GitLab we developed something we call "GitLab Flavored Markdown" (GFM). It extends the standard Markdown in a few significant ways to add some useful functionality.
...
@@ -49,7 +45,6 @@ You can use GFM in
...
@@ -49,7 +45,6 @@ You can use GFM in
* milestones
* milestones
* wiki pages
* wiki pages
<aname="newlines"/>
Newlines
Newlines
--------
--------
The biggest difference that GFM introduces is in the handling of linebreaks. With traditional Markdown you can hard wrap paragraphs of text and they will be combined into a single paragraph. We find this to be the cause of a huge number of unintentional formatting errors. GFM treats newlines in paragraph-like content as real line breaks, which is probably what you intended.
The biggest difference that GFM introduces is in the handling of linebreaks. With traditional Markdown you can hard wrap paragraphs of text and they will be combined into a single paragraph. We find this to be the cause of a huge number of unintentional formatting errors. GFM treats newlines in paragraph-like content as real line breaks, which is probably what you intended.
...
@@ -62,7 +57,6 @@ The next paragraph contains two phrases separated by a single newline character:
...
@@ -62,7 +57,6 @@ The next paragraph contains two phrases separated by a single newline character:
Roses are red
Roses are red
Violets are blue
Violets are blue
<aname="underscores"/>
Multiple underscores in words
Multiple underscores in words
-----------------------------
-----------------------------
It is not reasonable to italicize just _part_ of a word, especially when you're dealing with code and names that often appear with multiple underscores. Therefore, GFM ignores multiple underscores in words.
It is not reasonable to italicize just _part_ of a word, especially when you're dealing with code and names that often appear with multiple underscores. Therefore, GFM ignores multiple underscores in words.
...
@@ -73,7 +67,6 @@ It is not reasonable to italicize just _part_ of a word, especially when you're
...
@@ -73,7 +67,6 @@ It is not reasonable to italicize just _part_ of a word, especially when you're
perform_complicated_task
perform_complicated_task
do_this_and_do_that_and_another_thing
do_this_and_do_that_and_another_thing
<aname="autolink"/>
URL autolinking
URL autolinking
---------------
---------------
GFM will autolink standard URLs you copy and paste into your text.
GFM will autolink standard URLs you copy and paste into your text.
...
@@ -83,12 +76,10 @@ So if you want to link to a URL (instead of a textural link), you can simply put
...
@@ -83,12 +76,10 @@ So if you want to link to a URL (instead of a textural link), you can simply put
http://www.google.com
http://www.google.com
<aname="code"/>
## Code and Syntax Highlighting
## Code and Syntax Highlighting
Blocks of code are either fenced by lines with three back-ticks <code>```</code>, or are indented with four spaces. Only the fenced code blocks support syntax highlighting.
Blocks of code are either fenced by lines with three back-ticks <code>```</code>, or are indented with four spaces. Only the fenced code blocks support syntax highlighting.
```no-highlight
```no-highlight
Inline `code` has `back-ticks around` it.
Inline `code` has `back-ticks around` it.
```
```
...
@@ -147,7 +138,6 @@ s = "There is no highlighting for this."
...
@@ -147,7 +138,6 @@ s = "There is no highlighting for this."
But let's throw in a <b>tag</b>.
But let's throw in a <b>tag</b>.
```
```
<a name="emoji"/>
Emoji
Emoji
-----
-----
...
@@ -171,7 +161,6 @@ If you are :new: to this, don't be :fearful:. You can easily join the emoji :cir
...
@@ -171,7 +161,6 @@ If you are :new: to this, don't be :fearful:. You can easily join the emoji :cir
Consult the [Emoji Cheat Sheet](http://www.emoji-cheat-sheet.com/) for a list of all supported emoji codes. :thumbsup:
Consult the [Emoji Cheat Sheet](http://www.emoji-cheat-sheet.com/) for a list of all supported emoji codes. :thumbsup:
<a name="special"/>
Special GitLab References
Special GitLab References
-----
-----
...
@@ -179,7 +168,6 @@ GFM recognized special references.
...
@@ -179,7 +168,6 @@ GFM recognized special references.
You can easily reference e.g. a team member, an issue, or a commit within a project.
You can easily reference e.g. a team member, an issue, or a commit within a project.
GFM will turn that reference into a link so you can navigate between them easily.
GFM will turn that reference into a link so you can navigate between them easily.
GFM will recognize the following:
GFM will recognize the following:
* @foo : for team members
* @foo : for team members
...
@@ -189,13 +177,10 @@ GFM will recognize the following:
...
@@ -189,13 +177,10 @@ GFM will recognize the following:
* 1234567 : for commits
* 1234567 : for commits
* \[file\](path/to/file) : for file references
* \[file\](path/to/file) : for file references
<a name="standard"/>
----------------------------------
----------------------------------
# Standard Markdown
# Standard Markdown
----------------------------------
----------------------------------
<a name="headers"/>
## Headers
## Headers
```no-highlight
```no-highlight
...
@@ -230,7 +215,54 @@ Alt-H1
...
@@ -230,7 +215,54 @@ Alt-H1
Alt-H2
Alt-H2
------
------
<a name="emphasis"/>
### Header IDs and links
All markdown rendered headers automatically get IDs, except for comments.
On hover a link to those IDs becomes visible to make it easier to copy the link to the header to give it to someone else.
The IDs are generated from the content of the header according to the following rules:
1) remove the heading hashes `#` and process the rest of the line as it would be processed if it were not a header
2) from the result, remove all HTML tags, but keep their inner content
3) convert all characters to lowercase
4) convert all characters except `[a-z0-9_-]` into hyphens `-`
5) transform multiple adjacent hyphens into a single hyphen
6) remove trailing and heading hyphens
For example:
```
###### ..Ab_c-d. e [anchor](url) ![alt text](url)..
```
which renders as:
###### ..Ab_c-d. e [anchor](url) ![alt text](url)..
will first be converted by step 1) into a string like:
```
..Ab_c-d. e <a href="url">anchor</a> <img src="url" alt="alt text"/>..
```
After removing the tags in step 2) we get:
```
..Ab_c-d. e anchor ..
```
And applying all the other steps gives the id:
```
ab_c-d-e-anchor
```
Note in particular how:
- for markdown anchors `[text](url)`, only the `text` is used
- markdown images `![alt](url)` are completely ignored
## Emphasis
## Emphasis
```no-highlight
```no-highlight
...
@@ -251,8 +283,6 @@ Combined emphasis with **asterisks and _underscores_**.
...
@@ -251,8 +283,6 @@ Combined emphasis with **asterisks and _underscores_**.
Strikethrough uses two tildes. ~~Scratch this.~~
Strikethrough uses two tildes. ~~Scratch this.~~
<a name="lists"/>
## Lists
## Lists
```no-highlight
```no-highlight
...
@@ -283,7 +313,6 @@ Strikethrough uses two tildes. ~~Scratch this.~~
...
@@ -283,7 +313,6 @@ Strikethrough uses two tildes. ~~Scratch this.~~
- Or minuses
- Or minuses
+ Or pluses
+ Or pluses
<a name="links"/>
## Links
## Links
There are two ways to create links.
There are two ways to create links.
...
@@ -320,7 +349,6 @@ Some text to show that the reference links can follow later.
...
@@ -320,7 +349,6 @@ Some text to show that the reference links can follow later.
[1]: http://slashdot.org
[1]: http://slashdot.org
[link text itself]: http://www.reddit.com
[link text itself]: http://www.reddit.com
<a name="images"/>
## Images
## Images
Here's our logo (hover to see the title text):
Here's our logo (hover to see the title text):
...
@@ -343,7 +371,6 @@ Reference-style:
...
@@ -343,7 +371,6 @@ Reference-style:
[logo]: /assets/logo-white.png "Logo Title Text 2"
[logo]: /assets/logo-white.png "Logo Title Text 2"
<a name="blockquotes"/>
## Blockquotes
## Blockquotes
```no-highlight
```no-highlight
...
@@ -362,7 +389,6 @@ Quote break.
...
@@ -362,7 +389,6 @@ Quote break.
> This is a very long line that will still be quoted properly when it wraps. Oh boy let's keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can *put* **Markdown** into a blockquote.
> This is a very long line that will still be quoted properly when it wraps. Oh boy let's keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can *put* **Markdown** into a blockquote.
<a name="html"/>
## Inline HTML
## Inline HTML
You can also use raw HTML in your Markdown, and it'll mostly work pretty well.
You can also use raw HTML in your Markdown, and it'll mostly work pretty well.
...
@@ -385,7 +411,6 @@ You can also use raw HTML in your Markdown, and it'll mostly work pretty well.
...
@@ -385,7 +411,6 @@ You can also use raw HTML in your Markdown, and it'll mostly work pretty well.
<dd>Does *not* work **very** well. Use HTML <em>tags</em>.</dd>
<dd>Does *not* work **very** well. Use HTML <em>tags</em>.</dd>
</dl>
</dl>
<a name="hr"/>
## Horizontal Rule
## Horizontal Rule
```
```
...
@@ -418,7 +443,6 @@ ___
...
@@ -418,7 +443,6 @@ ___
Underscores
Underscores
<a name="lines"/>
## Line Breaks
## Line Breaks
My basic recommendation for learning how line breaks work is to experiment and discover -- hit <Enter> once (i.e., insert one newline), then hit it twice (i.e., insert two newlines), see what happens. You'll soon learn to get what you want. "Markdown Toggle" is your friend.
My basic recommendation for learning how line breaks work is to experiment and discover -- hit <Enter> once (i.e., insert one newline), then hit it twice (i.e., insert two newlines), see what happens. You'll soon learn to get what you want. "Markdown Toggle" is your friend.
...
@@ -441,8 +465,6 @@ This line is separated from the one above by two newlines, so it will be a *sepa
...
@@ -441,8 +465,6 @@ This line is separated from the one above by two newlines, so it will be a *sepa
This line is also begins a separate paragraph, but...
This line is also begins a separate paragraph, but...
This line is only separated by a single newline, so it's a separate line in the *same paragraph*.
This line is only separated by a single newline, so it's a separate line in the *same paragraph*.
<a name="tables"/>
## Tables
## Tables
Tables aren't part of the core Markdown spec, but they are part of GFM and Markdown Here supports them.
Tables aren't part of the core Markdown spec, but they are part of GFM and Markdown Here supports them.
...
@@ -461,10 +483,8 @@ Code above produces next output:
...
@@ -461,10 +483,8 @@ Code above produces next output:
| cell 1 | cell 2 |
| cell 1 | cell 2 |
| cell 3 | cell 4 |
| cell 3 | cell 4 |
------------
------------
<a name="references"/>
## References
## References
* This document leveraged heavily from the [Markdown-Cheatsheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet).
* This document leveraged heavily from the [Markdown-Cheatsheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet).