The Rocket.Chat documentation supports the Markdown Markup Language (You can also find a "Cheatsheet" here)
Markdown can be written in various different styles, in this document you will find the standard formatting guide for creating Rocket.Chat documentation.
You can run the Markdown linter locally by installing this Markdown Linter Tool
and running the command mdl ../
command on the docs main folder.
Headers should not be skipped, instead incremented one by one
Wrong:
# Header 1
### Header 3
We skipped out a 2nd level header in this document
Correct:
# Header 1
## Header 2
### Header 3
#### Header 4
## Another Header 2
### Another Header 3
The first header of the document should be a top level header (H1).
Wrong:
## This isn't a H1 header
### Another header
Correct:
# Start with a H1 header
## Then use a H2 for subsections
The header style used on documents should be atx
.
Wrong:
Setext style H1
===============
Setext style H2
---------------
### ATX style H3
Correct:
# ATX style H1
## ATX style H2
Lists should be created using dashes.
Wrong:
* Item 1
+ Item 2
- Item 3
Correct:
- Item 1
- Item 2
- Item 3
Lists should have consistent indentation, usually this rule will be triggered because of a typo.
Wrong:
- Item 1
- Nested Item 1
- Nested Item 2
- A misaligned item
Correct:
- Item 1
- Nested Item 1
- Nested Item 2
- Nested Item 3
Bulleted lists should start on the beginning of the line.
Wrong:
Some text
* List item
* List item
Correct:
Some test
* List item
* List item
List items should be indented using 4 spaces.
Wrong:
* List item
* Nested list item indented by 3 spaces
Correct:
* List item
* Nested list item indented by 4 spaces
There shouldn't have any trailing spaces after the end of the lines.
To fix this, find the line that is triggered and remove any trailing spaces from the end.
Spaces should be used for indentation instead of hard tabs.
To fix this, replace any hard tab characters with spaces instead.
When creating links you should use the []
surrounding the text and ()
surrounding the link.
Wrong:
(Incorrect link syntax)[http://www.example.com/]
Correct:
[Correct link syntax](http://www.example.com/)
There should not have more than one consecutive blank line on the document.
Wrong:
Some text here
Some more text here
Correct:
Some text here
Some more text here
There should be a space after the hashes on atx style headers.
Wrong:
#Header 1
##Header 2
Correct:
# Header 1
## Header 2
There shouldn't have more than 1 space after the hash on atx style headers.
Wrong:
# Header 1
## Header 2
Correct:
# Header 1
## Header 2
All headers should have a blank line both before and after (except where the header is at the beginning or end of the document)
Wrong:
# Header 1
Some text
Some more text
## Header 2
Correct:
# Header 1
Some text
Some more text
## Header 2
Wrong:
Some text
# Indented header
Correct:
Some text
# Header
There should only have one top level header (h1
) on a document.
Wrong:
# Top level header
# Another top level header
Correct:
# Title
## Header
## Another header
Blockquote should not have more than one space after the blockquote symbol ( >
).
Wrong:
> This is a block quote with bad indentation
> there should only be one.
Correct:
> This is a block quote with bad indentation
> there should only be one.
There shouldn't have a blank line inside the same blockquote.
Wrong:
> This is a blockquote
> which is immediately followed by
> this blockquote. Unfortunately
> In some parsers, these are treated as the same blockquote.
Correct:
> This is a blockquote.
And Jimmy also said:
> This too is a blockquote.
Alternatively, if they are supposed to be the same quote, then add the blockquote symbol at the beginning of the blank line
> This is a blockquote.
>
> This is the same blockquote.
Ordered lists should be ordered by a prefix that increases in numerical order.
Wrong:
1. Do this.
1. Do that.
1. Done.
Correct:
1. Do this.
2. Do that.
3. Done.
There should be only one space after a list marker.
Wrong:
*Foo
*Bar
*Baz
1. Foo
1. Bar
1. Baz
Correct:
* Foo
* Bar
* Baz
1. Foo
1. Bar
1. Baz
1. Foo
* Bar
1. Baz
Fenced code blocks should be surrounded by blank lines.
Wrong:
Some text
```
Code block
```
```
Another code block
```
Some more text
Correct:
Some text
```
Code block
```
```
Another code block
```
Some more text
Lists should be surrounded by blank lines.
Wrong:
Some text
* Some
* List
1. Some
2. List
Some text
Correct:
Some text
* Some
* List
1. Some
2. List
Some text
There should no bare urls on the document, surround the links with angle brackets (< >
).
Wrong:
For more information, see http://www.example.com/.
Correct:
For more information, see <http://www.example.com/>.
Horizontal rules should be created using three slashes (---
).
Wrong:
***
* * *
****
Correct:
---
There shouldn't have spaces inside emphasis markers (bold, italic).
Wrong:
Here is some ** bold ** text.
Here is some _ italic _ text.
Correct:
Here is some **bold** text.
Here is some _italic_ text.
There shouldn't have spaces inside code span elements.
Wrong:
` some text `
`some text `
` some text`
Correct:
`some text`
There shouldn't have spaces inside link texts.
Wrong:
[ a link ](http://www.example.com/)
Correct:
[a link](http://www.example.com/)