Markdown Style Guide
Mon Jul 01 2024 Pin
1029 words · 6 minutes

Markdown Style Guide


Table of Contents

Here is a sample of basic Markdown syntax that can be used when writing content in Astro.

Quick Tips Link to Quick Tips

  • Keep headings hierarchical and avoid skipping levels
  • Leave a blank line between blocks for consistent rendering
  • Prefer fenced code blocks with language identifiers

Headings Link to Headings

The following HTML <h1><h6> elements represent six levels of section headings. <h1> is the highest section level while <h6> is the lowest.

H1 Link to H1

H2 Link to H2

H3 Link to H3

H4 Link to H4

H5 Link to H5
H6 Link to H6

Paragraph Link to Paragraph

Markdown allows you to write text naturally. Paragraphs are separated by a blank line.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

You can emphasize text using italics or bold.

Images Link to Images

Syntax Link to Syntax

MARKDOWN
1
![Alt text](./full/or/relative/path/of/image)

Output Link to Output

blog placeholder

Blockquotes Link to Blockquotes

The blockquote element represents content that is quoted from another source.

Blockquote without attribution Link to Blockquote without attribution

Syntax Link to Syntax

MARKDOWN
1
2
> This is a blockquote.
> **Note** that you can use _Markdown syntax_ within a blockquote.

Output Link to Output

This is a blockquote. Note that you can use Markdown syntax within a blockquote.

Blockquote with attribution Link to Blockquote with attribution

Syntax Link to Syntax

MARKDOWN
1
2
> Don't communicate by sharing memory, share memory by communicating.<br>
> — <cite>Rob Pike[^1]</cite>

Output Link to Output

Don’t communicate by sharing memory, share memory by communicating.
Rob Pike1

Tables Link to Tables

Syntax Link to Syntax

MARKDOWN
1
2
3
| Italics   | Bold     | Code   |
| --------- | -------- | ------ |
| _italics_ | **bold** | `code` |

Output Link to Output

ItalicsBoldCode
italicsboldcode

Code Blocks Link to Code Blocks

To create a code block, use three backticks (```) on a new line, write your code, and close with three backticks. To highlight language-specific syntax, add the language name after the first three backticks (e.g., cpp, javascript, python, bash).

Syntax Link to Syntax

MARKDOWN
1
2
3
4
5
6
7
8
9
```cpp
#include <bits/stdc++.h>
using namespace std;

int main() {
    cout << "Hello, World!" << endl;
    return 0;
}
```

Output Link to Output

CPP
1
2
3
4
5
6
7
#include <bits/stdc++.h>
using namespace std;

int main() {
    cout << "Hello, World!" << endl;
    return 0;
}

List Types Link to List Types

Ordered List Link to Ordered List

Syntax Link to Syntax

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

Output Link to Output

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

Unordered List Link to Unordered List

Syntax Link to Syntax

MARKDOWN
1
2
3
- List item
- Another item
- And another item

Output Link to Output

  • List item
  • Another item
  • And another item

Nested list Link to Nested list

Syntax Link to Syntax

MARKDOWN
1
2
3
4
5
6
7
- Fruit
  - Apple
  - Orange
  - Banana
- Dairy
  - Milk
  - Cheese

Output Link to Output

  • Fruit
    • Apple
    • Orange
    • Banana
  • Dairy
    • Milk
    • Cheese

Other Elements Link to Other Elements

Syntax Link to Syntax

MARKDOWN
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<abbr title="Graphics Interchange Format">GIF</abbr> is a bitmap image format.

H<sub>2</sub>O

X<sup>n</sup> + Y<sup>n</sup> = Z<sup>n</sup>

Press <kbd>CTRL</kbd> + <kbd>ALT</kbd> + <kbd>Delete</kbd> to end the session.

Most <mark>salamanders</mark> are nocturnal.

## Common Mistakes

- Missing blank lines between blocks can break layout
- Tables need a header separator row to render properly
- Lists and code blocks require consistent indentation

## Summary

- Markdown is readable plain text with simple syntax
- Use headings, lists, tables, and code blocks to structure content
- Keep formatting consistent to avoid rendering surprises

Output Link to Output

GIF is a bitmap image format.

H2O

Xn + Yn = Zn

Press CTRL + ALT + Delete to end the session.

Most salamanders are nocturnal.

Footnotes

  1. The above quote is excerpted from Rob Pike’s talkduring Gopherfest, November 18, 2015.

Thanks for reading!

Markdown Style Guide

Mon Jul 01 2024 Pin
1029 words · 6 minutes

© EveSunMaple | CC BY-SA 4.0