Skip to main content

Markdown

Markdown is a lightweight markup language that allows you to write formatted text using a simple and intuitive syntax. It is commonly used for creating documentation, README files, blog posts, and more. This guide will introduce you to the basics of Markdown, enabling you to create formatted documents effortlessly.

Markdown plays a crucial role in the Docusaurus module as it is the primary content format for creating documentation pages, making it an essential part of the documentation workflow. This is a markdown language guide, to learn more about writing documentation with markdown, see Documentation.

tip

To view this file's markdown code, scroll to the bottom of the page and click on "Edit this page."

tip

You can test out writing code in markdown by using an online markdown editor.

Headers

Headers are defined using hash (#) symbols before the text and demarcate sections in your documentation (titles, subtitles, and their constituent content). The number of hash symbols determines the header level. For example:

Markdown
# Heading 1
## Heading 2
### Heading 3
#### Heading 4

In Docusaurus, the above example will appears as below:

Docusaurus Example

Header 1

Header 2

Header 3

Header 4

Text Formatting

You can apply various text formatting styles in Markdown:

  • Bold: Enclose the text with double asterisks (**text**) or double underscores (__text__).
  • Italic: Enclose the text with single asterisks (*text*) or single underscores (_text_).
  • Strikethrough: Enclose the text with double tildes (~~text~~).
  • Code: Enclose the text with backticks (`code`).
Docusaurus Example

Bold: Bold Text!
Italic: Italic Text
Strikethrough: Strikethrough Text
Code: my code text

Lists

You can create both ordered and unordered lists:

Unordered List:

Markdown
- Item 1
- Item 2
- Subitem 2.1
- Subitem 2.2
- Item 3

Ordered List:

Markdown
1. First item
2. Second item
3. Third item
Docusaurus Example

Unordered list:

  • Item 1
  • Item 2
    • Subitem 2.1
    • Subitem 2.2
  • Item 3

Ordered list:

  1. First item
  2. Second item
  3. Third item

You can add links in Markdown using square brackets and parentheses:

Markdown
[Link Text](https://www.example.com)

Images

You can include images using a similar syntax to links but with an exclamation mark at the beginning:

![Alt Text](image-url.jpg)

Code Blocks

To display code blocks, enclose the code within triple backticks:

```js title="My Title"
console.log("Hello, Markdown!");
```
Docusaurus Example
My Title
console.log("Hello, Markdown!");

Tables

Tables are created using vertical bars and hyphens:

Markdown
| Column 1 | Column 2 |
|----------|----------|
| Cell 1 | Cell 2 |

If you're finding this syntax difficult, you try using an online markdown table generator here.

Docusaurus Example
Column 1Column 2
Cell 1Cell 2

Blockquotes

To create blockquotes, use the greater than (>) symbol:

Markdown
> This is a blockquote.

Example:

This is a blockquote. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam non augue quis ligula malesuada finibus. Fusce neque dolor, aliquet et ornare viverra, tempus vel sapien. Phasellus vitae commodo dolor.

Escaping Characters

To escape special characters in Markdown, use a backslash (\):

Markdown
\*This text is not in italics\*
Docusaurus Example

*This text is not in italics*