Post

Markdown Examples

Markdown Examples

Markdown Cheat Sheet

Downloaded from The Markdown Guide.

I’ve edited it to show the code in a fenced code block prior to the rendered output.

This Markdown cheat sheet provides a quick overview of all the Markdown syntax elements. It can’t cover every edge case, so if you need more information about any of these elements, refer to the reference guides for basic syntax and extended syntax.

Basic Syntax

These are the elements outlined in John Gruber’s original design document. All Markdown applications support these elements.

Headings

1
2
3
4
5
### Heading

# H1
## H2
### H3

Heading

H1

H2

H3


Bold

1
**bold text**

bold text


Italic

1
*italicized text*

italicized text


Blockquote

1
> blockquote

blockquote


Ordered List

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

Unordered List

1
2
3
- First item
- Second item
- Third item
  • First item
  • Second item
  • Third item

Code

1
`code`

code


Horizontal Rule

1
---


1
[Markdown Guide](https://www.markdownguide.org)

Markdown Guide


Image

1
![alt text](https://www.markdownguide.org/assets/images/tux.png)

alt text


Table

1
2
3
4
| Syntax | Description |
| ----------- | ----------- |
| Header | Title |
| Paragraph | Text |
Syntax Description
Header Title
Paragraph Text

Basic Fenced Code Block

(All the example code is in a Basic Fenced Code Block)

1
2
3
4
5
6
7
```
{
  "firstName": "John",
  "lastName": "Smith",
  "age": 25
}
```
1
2
3
4
5
{
  "firstName": "John",
  "lastName": "Smith",
  "age": 25
}

Numbered Code Block

1
2
3
4
```text
This is a common code snippet, without syntax highlight and line number.
This is another line.
```
1
2
This is a common code snippet, without syntax highlight and line number.
This is another line.

Specific Language Code Block

1
2
3
4
5
6
```bash
if [ $? -ne 0 ]; then
  echo "The command was not successful.";
  #do the needful / exit
fi;
```
1
2
3
4
if [ $? -ne 0 ]; then
  echo "The command was not successful.";
  #do the needful / exit
fi;

Code Block With Filename

1
2
3
4
5
6
```sass
@import
  "colors/light-typography",
  "colors/dark-typography";
```
{: file='_sass/jekyll-theme-chirpy.scss'}
1
2
3
@import
  "colors/light-typography",
  "colors/dark-typography";

Footnote

1
2
3
4
5
6
7
8
9
10
11
Here's a simple footnote,[^1] and here's a longer one.[^bignote]

[^1]: This is the first footnote.

[^bignote]: Here's one with multiple paragraphs and code.

    Indent paragraphs to include them in the footnote.

    `{ my code }`

    Add as many paragraphs as you like.

Here’s a simple footnote,1 and here’s a longer one.2


Heading ID

1
### My Great Heading {#custom-id}

My Great Heading


Description list

1
2
3
4
5
Sun
: the star around which the earth orbits

Moon
: the natural satellite of the earth, visible by reflected light from the sun
Sun
the star around which the earth orbits
Moon
the natural satellite of the earth, visible by reflected light from the sun

Prompts

1
2
3
4
5
6
7
8
9
10
11
> An example showing the `tip` type prompt.
{: .prompt-tip }

> An example showing the `info` type prompt.
{: .prompt-info }

> An example showing the `warning` type prompt.
{: .prompt-warning }

> An example showing the `danger` type prompt.
{: .prompt-danger }

An example showing the tip type prompt.

An example showing the info type prompt.

An example showing the warning type prompt.

An example showing the danger type prompt.


Strikethrough

1
~~The world is flat.~~

The world is flat.


Task List

1
2
3
- [x] Write the press release
- [ ] Update the website
- [ ] Contact the media
  • Write the press release
  • Update the website
  • Contact the media

Mathematics

The mathematics powered by MathJax:

1
2
3
4
5
6
7
$$
\begin{equation}
  \sum_{n=1}^\infty 1/n^2 = \frac{\pi^2}{6}
  \label{eq:series}
\end{equation}
$$
We can reference the equation as \eqref{eq:series}.

\(\begin{equation} \sum_{n=1}^\infty 1/n^2 = \frac{\pi^2}{6} \label{eq:series} \end{equation}\) We can reference the equation as \eqref{eq:series}.


More Mathematics

1
2
3
When $a \ne 0$, there are two solutions to $ax^2 + bx + c = 0$ and they are

$$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$

When $a \ne 0$, there are two solutions to $ax^2 + bx + c = 0$ and they are

\[x = {-b \pm \sqrt{b^2-4ac} \over 2a}\]

Emoji

1
2
3
That is so funny! :joy:

I give this plugin two :+1:!

That is so funny! :joy:

I give this plugin two :+1:!

Full list of emojis

Highlight

1
I need to highlight these ==very important words==.

I need to highlight these ==very important words==.


Subscript

1
H~2~O

H~2~O


Superscript

1
X^2^

X^2^


  1. This is the first footnote. ↩︎

  2. Here’s one with multiple paragraphs and code.

    Indent paragraphs to include them in the footnote.

    { my code }

    Add as many paragraphs as you like. ↩︎

This post is licensed under CC BY 4.0 by the author.