Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

Create a new post

Bash
1
$ hexo new "My New Post"

More info: Writing

Run server

Bash
1
$ hexo server

More info: Server

Generate static files

Bash
1
$ hexo generate

More info: Generating

Deploy to remote sites

Bash
1
$ hexo deploy

More info: Deployment

Complete Examples of Common Markdown Formatting

1. Headers

Level 2 Header

Level 3 Header

Level 4 Header

Level 5 Header
Level 6 Header

2. Paragraphs and Line Breaks

This is a regular paragraph. Markdown paragraphs require an empty line between them.

This is the second paragraph.
This line uses two trailing spaces for a soft line break.


3. Emphasis

Bold text

Italic text

Bold and Italic text

Strikethrough text

Highlighted text

Note: ==highlight== is not supported by all Markdown renderers. A more universal method is shown below:

HTML Highlighted Text


4. Lists

4.1 Unordered List

  • Item 1
  • Item 2
  • Item 3
    • Sub-item A
    • Sub-item B

4.2 Ordered List

  1. Step 1
  2. Step 2
  3. Step 3
    1. Sub-step 1
    2. Sub-step 2

4.3 Task List

  • Completed Task
  • Unfinished Task
  • Pending Task

5. Blockquotes

This is a first-level blockquote.

This is a nested blockquote.


HEXO Official Website

GitHub

https://www.markdownguide.org

6.4 Image

Example Image


7. Inline Code and Code Blocks

7.1 Inline Code

Use console.log("Hello Markdown") to output text.

7.2 Code Block

JavaScript
1
2
3
4
5
function greet(name) {
return `Hello, ${name}`;
}

console.log(greet("Markdown"));
Python
1
2
3
4
def add(a: int, b: int) -> int:
return a + b

print(add(1, 2))

7.3 Code Block Diff

Diff
1
2
3
4
5
6
7
8
9
10
diff --git a/example.js b/example.js
index 1234567..89abcde 100644
--- a/example.js
+++ b/example.js
@@ -1,5 +1,6 @@
function hello() {
- console.log("Hello");
+ console.log("Hello Markdown");
+ console.log("Diff syntax");
}

8. Tables

Name Type Description
Markdown Markup Language Lightweight text formatting language
Mermaid Chart Syntax Generate charts from text
GitHub Alert Extended Syntax GitHub-style alert boxes

9. Mathematical Formulas

9.1 Inline Math

The mass-energy equivalence formula is E=mc2E = mc^2.

9.2 Math Block

$
\int_{-\infty}^{+\infty} e^{-x^2} , dx = \sqrt{\pi}
$


10. Subscript and Superscript

10.1 HTML Method

The chemical formula for water is H2O.

The formula for squares is x2 + y2 = z2.

10.2 Math Formula Method

Chemical formula for water: H2OH_2O

Formula for squares: x2+y2=z2x^2 + y^2 = z^2


11. Horizontal Rules





12. GitHub-Style Alert Boxes

Note

This is a regular note.

Tip

This is a practical tip.

Important

This is important information.

Warning

This is a warning.

Caution

This is a high-risk reminder.


13. Mermaid Diagrams

Requires a Markdown renderer that supports Mermaid, such as GitHub, Obsidian, Typora, VS Code extensions, etc.

13.1 Flowchart

Mermaid
flowchart TD
    A[Start] --> B{Does condition hold?}
    B -- Yes --> C[Execute Plan A]
    B -- No --> D[Execute Plan B]
    C --> E[End]
    D --> E

13.2 Sequence Diagram

Mermaid
sequenceDiagram
    participant User as User
    participant App as Application
    participant API as API Service
    participant DB as Database

    User->>App: Send Request
    App->>API: Call Endpoint
    API->>DB: Query Data
    DB-->>API: Return Result
    API-->>App: Return Response
    App-->>User: Display Result

13.3 Class Diagram

Mermaid
classDiagram
    class User {
        +String name
        +String email
        +login()
        +logout()
    }

    class Admin {
        +manageUsers()
    }

    User <|-- Admin

13.4 State Diagram

Mermaid
stateDiagram-v2
    [*] --> Idle
    Idle --> Loading: Submit Request
    Loading --> Success: Request Succeeded
    Loading --> Error: Request Failed
    Success --> [*]
    Error --> Idle: Retry

14. Escaping Characters

If you need to display Markdown special characters, use a backslash to escape them.

# This is not a header

- This is not a list item

* This is not italic *


15. Footnotes

This is a sentence with a footnote.[^1]

[^1]: This is the footnote content.


16. Definition Lists

Term One
This is the definition for term one.
Term Two
This is the definition for term two.

17. Collapsed Content

Click to expand

This is the collapsed content.

  • Supports lists
  • Supports code
  • Supports formulas: a2+b2=c2a^2 + b^2 = c^2

18. Comprehensive Example

Important

The following example mixes headers, lists, links, formulas, code, and Mermaid.

Project Initialization Process

  1. Read the Markdown Guide
  2. Install dependencies
  3. Write code
  4. Submit a Pull Request
Bash
1
2
npm install
npm run dev

Complexity estimate: O(nlogn)O(n \log n).

Mermaid
flowchart LR
    A[Write Documentation] --> B[Local Preview]
    B --> C{Does it pass?}
    C -- Yes --> D[Commit]
    C -- No --> A