The Rocket.Chat documentation utilizes the Markdown Markup Language (a "Cheatsheet" is available here). Markdown can be composed in a variety of styles, but this document outlines the standard formatting guide for creating Rocket.Chat documentation. Please note, we are presently implementing a markdown linter on incoming Pull Requests. Therefore, it's advisable to ensure your commits pass the linting test prior to submitting a Pull Request. Each rule listed here includes its respective code, so if the linter flags an issue, you can refer back to this guide to identify the broken rule.
{% hint style="warning" %} This markdown guide is intended solely for contributing to documentation. To view the supported markdown formats in a Rocket.Chat workspace, please refer to the Messages user guide. {% endhint %}
Rules | Description | Wrong | Correct |
---|---|---|---|
MD001 - Header levels should only increment by one level at a time | Headers should not be skipped, but instead incremented one by one. |
|
We skipped out a 2nd level header in this document |
| | MD002 - First header should be a top-level header | The first header of the document should be a top-level header (H1). |# Header 1
|## This isn't a H1 header
# Start with a H1 header
|
| MD003 - Header style | The header style used on documents should be atx
. | |Setext style H1
| | MD004 - Unordered list style | Lists should be created using asterisks. |# ATX style H1
* Item 1
- Item 2
Item 3
* Item 1
-
Item 2
Item 3
* Item 1
* Nested Item 1
* Nested Item 2
A misaligned item
* Item 1
Nested Item 1
Nested Item 2
Nested Item 3 --->Aligned
Some text
List item
List item
Some text
List item
List item
* List item
Nested list item indented by 3 spaces
* List item
Nested list item indented by 4 spaces
[]
surrounding the text and ()
surrounding the link. | (Incorrect link syntax)[http://www.example.com/]
|Some text here
Some more text here
| | MD018 - Use space after hash on atx style header |Some text here
Some more text here
There should be a space after the hashes on atx style headers.
||#Header 1
##Header 2
| |# Header 1
MD019 - No multiple spaces after hash on atx style header
| In atx style headers, there should not be more than one space following the hash symbol. ||# Header 1
| | MD022 - Headers should be surrounded by blank lines | Every header should be preceded and followed by a blank line, unless the header is positioned at the start or end of the document. |# Header 1
|# Header 1 Some text
Some more text
| | MD023 - Headers must start at the beginning of the line | |# Header 1
Some text
Some more text
|Some text
# Indented header
| | MD025 - No multiple top-level headers in the same document | A document should contain only one top-level header (h1) |Some text
|# Top level header
| | MD027 - No multiple spaces after the blockquote symbol | Blockquote should not have more than one space after the blockquote symbol (# Title
>
). | |> This is a block quote with bad indentation
there should only be one.
> This is a block quote with good indentation
there should only be one.
|> This is a blockquote which is immediately followed by
this blockquote. Unfortunately In some parsers, these are treated as the same blockquote.
| | MD029 - Ordered list item prefix | Ordered lists should be ordered by a prefix that increases in numerical order. |> This is a blockquote.
And Jimmy also said:
This too is a blockquote.
|1. Do this.
Do that.
Done.
1. Do this.
Do that.
Done.
*Foo
*Bar
*Baz
Foo
Bar
Baz
| | MD031 - Fenced code blocks should be surrounded by blank lines | | | | | MD032 - Lists should be surrounded by blank lines | |* Foo
- Bar
- Baz
- Foo
- Bar
Baz
|Some text
- Some
- List
- Some
List Some text
| | MD034 - No bare URLs | Bare URLs should not be present in the document; instead, enclose the links within angle brackets (< >). |Some text
- Some
- List
- Some
- List
Some text
For more information, see http://www.example.com/.
For more information, see <http://www.example.com/>.
---
). | |***
---
|Here is some ** bold ** text.
Here is some _ italic _ text.
| | MD038 - No spaces inside code span elements | Spaces should not be included within code span elements. |Here is some bold text.
Here is some italic text.
|
some text
some text
some text
some text
codeblock using indentation.
```
codeblock without indentation.
</code></pre> |
{% hint style="info" %}
For a comprehensive guide on contributing to Rocket.Chat documentation, visit [.](./ "mention")and [documentation-template.md](documentation-template.md "mention")
{% endhint %}