List of Markdown expressions

Posted
  • Dev

Here is a list of Markdown syntax you can use in this blog.

1. Headings

# Heading 1
 
## Heading 2
 
### Heading 3
 
#### Heading 4
 
##### Heading 5
 
###### Heading 6

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

2. Text Formatting

**Bold text**
 
_Italic text_
 
**_Bold and italic text_**
 
~~Strikethrough text~~
 
`Inline code`
 
**Bold text with _nested italic_**

Bold text

Italic text

Bold and italic text

Strikethrough text

Inline code

Bold text with nested italic

[OpenAI](https://www.openai.com)
 
[Example](https://example.com "Example title")
 
<https://example.com>
 
<someone@example.com>
 
Reference-style link: [Markdown Guide][guide]
 
[guide]: https://www.markdownguide.org/

OpenAI

Example

https://example.com

someone@example.com

Reference-style link: Markdown Guide

[card](https://github.com)

4. Paragraphs

This is the first paragraph.
 
This is the second paragraph.
 
This line ends with two spaces.  
This line starts on a new line.

This is the first paragraph.

This is the second paragraph.

This line ends with two spaces.
This line starts on a new line.

5. Blockquotes

> This is a blockquote.
 
> This is a multi-line blockquote.
>
> It can contain multiple paragraphs.
 
> You can also nest blockquotes.
>
> > This is a nested blockquote.

This is a blockquote.

This is a multi-line blockquote.

It can contain multiple paragraphs.

You can also nest blockquotes.

This is a nested blockquote.

6. Unordered Lists

- Apple
- Banana
- Orange
- Frontend
  - HTML
  - CSS
- Backend
  - Python
  - Go
  • Apple
  • Banana
  • Orange
  • Frontend
    • HTML
    • CSS
  • Backend
    • Python
    • Go

7. Ordered Lists

1. First item
2. Second item
3. Third item
4. Fourth item
5. Prepare the environment.
   1. Install dependencies.
   2. Configure the project.
   3. Run the tests.
6. Build the application.
7. Deploy the application.
  1. First item
  2. Second item
  3. Third item
  4. Fourth item
  5. Prepare the environment.
    1. Install dependencies.
    2. Configure the project.
    3. Run the tests.
  6. Build the application.
  7. Deploy the application.

8. Task Lists

- [x] Create the project
- [x] Install dependencies
- [x] Write documentation
- [ ] Add unit tests
- [ ] Deploy to production
  • Create the project
  • Install dependencies
  • Write documentation
  • Add unit tests
  • Deploy to production

9. Code

Inline code

`console.log("Hello, world!");`

console.log("Hello, world!");

JavaScript

```javascript
function greet(name) {
  return `Hello, ${name}!`;
}
 
const message = greet("Alice");
console.log(message);
```
function greet(name) {
  return `Hello, ${name}!`;
}
 
const message = greet("Alice");
console.log(message);

Python

```python
def greet(name):
    return f"Hello, {name}!"
 
print(greet("Alice"))
```
def greet(name):
    return f"Hello, {name}!"
 
print(greet("Alice"))

JSON

```json
{
  "name": "Alice",
  "age": 30,
  "active": true,
  "skills": ["Python", "JavaScript", "Markdown"]
}
```
{
  "name": "Alice",
  "age": 30,
  "active": true,
  "skills": ["Python", "JavaScript", "Markdown"]
}

Bash

```bash
npm install
npm run build
npm test
```
npm install
npm run build
npm test

HTML

```html
<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Hello</title>
  </head>
  <body>
    <h1>Hello, world!</h1>
  </body>
</html>
```
<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Hello</title>
  </head>
  <body>
    <h1>Hello, world!</h1>
  </body>
</html>

CSS

```css
.container {
  display: flex;
  justify-content: center;
  align-items: center;
}
```
.container {
  display: flex;
  justify-content: center;
  align-items: center;
}

SQL

```sql
SELECT
    id,
    name,
    email
FROM users
WHERE active = true
ORDER BY name ASC;
```
SELECT
    id,
    name,
    email
FROM users
WHERE active = true
ORDER BY name ASC;

10. Code Block Without Language

```
This is a plain code block.
 
    Indentation is preserved.
    Line breaks are preserved.
 
No syntax highlighting is specified.
```
This is a plain code block.

    Indentation is preserved.
    Line breaks are preserved.

No syntax highlighting is specified.

11. Horizontal Rules

---
---


12. Tables

| Name  | Age | Role      |
| ----- | --: | --------- |
| Alice |  30 | Developer |
| Bob   |  25 | Designer  |
| Carol |  35 | Manager   |
NameAgeRole
Alice30Developer
Bob25Designer
Carol35Manager

Table Alignment

| Left | Center | Right |
| :--- | :----: | ----: |
| A    |   B    |     C |
| D    |   E    |     F |
| G    |   H    |     I |
LeftCenterRight
ABC
DEF
GHI

13. Escaping Characters

\*Not italic\*
 
\*\*Not bold\*\*
 
\# Not a heading
 
\[Not a link\]
 
\`Not inline code\`
 
Escaped characters:
 
\* \_ \# \+ \- \. \! \[ \] \( \) \{ \} \> \| \~

*Not italic*

**Not bold**

# Not a heading

[Not a link]

`Not inline code`

Escaped characters:

* _ # + - . ! [ ] ( ) { } > | ~

14. HTML

This is <u>underlined text</u>.
 
This is <mark>highlighted text</mark>.
 
This is <small>small text</small>.
 
H<sub>2</sub>O
 
E = mc<sup>2</sup>
 
Press <kbd>Ctrl</kbd> + <kbd>C</kbd> to copy.
 
Press <kbd>Ctrl</kbd> + <kbd>V</kbd> to paste.

This is underlined text.

This is highlighted text.

This is small text.

H2O

E = mc2

Press Ctrl + C to copy.

Press Ctrl + V to paste.

15. HTML Block

<div align="center">
 
This paragraph is centered using HTML.
 
</div>

This paragraph is centered using HTML.

<details>
<summary>Click to expand</summary>
 
This content is hidden until the section is expanded.
 
- Item one
- Item two
- Item three
 
</details>
Click to expand

This content is hidden until the section is expanded.

  • Item one
  • Item two
  • Item three

16. Footnotes

Markdown supports footnotes in many implementations.[^1]
 
You can also use named footnotes.[^note]
 
[^1]: This is the first footnote.
 
[^note]: This is a named footnote.

Markdown supports footnotes in many implementations.1

You can also use named footnotes.2

17. Definition Lists

Term
: Definition of the term.
 
Markdown
: A lightweight markup language.
Term
Definition of the term.
Markdown
A lightweight markup language.

18. Alerts

> [!NOTE]
> This is a note.
 
> [!TIP]
> This is a useful tip.
 
> [!IMPORTANT]
> This information is important.
 
> [!WARNING]
> Be careful when changing production settings.
 
> [!CAUTION]
> This operation cannot easily be undone.

NOTE

This is a note.

TIP

This is a useful tip.

IMPORTANT

This information is important.

WARNING

Be careful when changing production settings.

CAUTION

This operation cannot easily be undone.

19. Mathematical Expressions

Inline math

$E = mc^2$
 
$a^2 + b^2 = c^2$

E=mc2E = mc^2

a2+b2=c2a^2 + b^2 = c^2

Block math

$$
E = mc^2
$$
 
$$
\sum_{i=1}^{n} i
=
\frac{n(n+1)}{2}
$$
E=mc2E = mc^2 ∑i=1ni=n(n+1)2\sum_{i=1}^{n} i = \frac{n(n+1)}{2}

20. Mermaid

Flowchart

```mermaid
flowchart TD
    A[Start] --> B{Is it working?}
    B -->|Yes| C[Done]
    B -->|No| D[Debug]
    D --> B
```
flowchart TD
    A[Start] --> B{Is it working?}
    B -->|Yes| C[Done]
    B -->|No| D[Debug]
    D --> B

Sequence Diagram

```mermaid
sequenceDiagram
    participant User
    participant Server
    participant Database
 
    User->>Server: Send request
    Server->>Database: Query data
    Database-->>Server: Return data
    Server-->>User: Send response
```
sequenceDiagram
    participant User
    participant Server
    participant Database

    User->>Server: Send request
    Server->>Database: Query data
    Database-->>Server: Return data
    Server-->>User: Send response

Class Diagram

```mermaid
classDiagram
    class User {
        +String name
        +String email
        +login()
        +logout()
    }
 
    class Admin {
        +deleteUser()
    }
 
    User <|-- Admin
```
classDiagram
    class User {
        +String name
        +String email
        +login()
        +logout()
    }

    class Admin {
        +deleteUser()
    }

    User <|-- Admin

23. HTML Comments

<!--
This is an HTML comment.
 
It will not normally be displayed
when the Markdown is rendered.
-->
 
Visible text after the comment.

Visible text after the comment.

24. Nested Formatting

**Bold text containing _italic text_.**
 
**Bold text containing `inline code`.**
 
**Bold text containing ~~strikethrough~~.**
 
> A quote containing **bold text**, _italic text_, and `inline code`.
 
- **Bold list item**
- _Italic list item_
- [Linked list item](https://example.com)
- `Code list item`

Bold text containing italic text.

Bold text containing inline code.

Bold text containing strikethrough.

A quote containing bold text, italic text, and inline code.

[Normal link](https://example.com)
 
**[Bold link](https://example.com)**
 
_[Italic link](https://example.com)_
 
**_[Bold italic link](https://example.com)_**
 
[Link with title](https://example.com "This is a title")

Normal link

Bold link

Italic link

Bold italic link

Link with title

26. Images

Basic Image

![Basic Sample Image](/images/blog/list_of_markdown_expressions/sample.jpg)

Basic Sample Image

Image with Hover Title

![Sample with Title](/images/blog/list_of_markdown_expressions/sample.jpg "Photograph of a stunning landscape")

Sample with Title

Clickable Linked Image (Opens Full Resolution)

[![Clickable Image](/images/blog/list_of_markdown_expressions/sample.jpg)](/images/blog/list_of_markdown_expressions/sample.jpg)

Clickable Image

Figure with Caption

<figure>
  <img src="/images/blog/list_of_markdown_expressions/sample.jpg" alt="Figure Sample" />
  <figcaption>Figure 1: Landscape photograph rendered with a custom figure caption.</figcaption>
</figure>
Figure Sample
Figure 1: Landscape photograph rendered with a custom figure caption.

Reference-style Image

![Reference Style Example][sample-ref-image]
 
[sample-ref-image]: /images/blog/list_of_markdown_expressions/sample.jpg "Reference Image Title"

Reference Style Example

Resized Image (HTML width attribute)

<img src="/images/blog/list_of_markdown_expressions/sample.jpg" alt="Small sized image" width="320" />
Small sized image

Multi-column Grid (2 Images Side-by-Side)

<div style="display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin: 1.5rem 0;">
  <img src="/images/blog/list_of_markdown_expressions/sample.jpg" alt="Grid item 1" style="margin: 0; width: 100%; height: auto;" />
  <img src="/images/blog/list_of_markdown_expressions/sample.jpg" alt="Grid item 2" style="margin: 0; width: 100%; height: auto;" />
</div>
Grid item 1 Grid item 2

Footnotes

  1. This is the first footnote. ↩

  2. This is a named footnote. ↩