Markdown Basics
High Contrast
Dark Mode
Light Mode
Sepia
Forest
1 min read162 words

Markdown Basics

This page demonstrates the Markdown features supported by GitBook Online Generator.

Text Formatting

You can use bold text, italic text, ~~strikethrough~~, and inline code.

Combine them: bold and italic, bold with code.

Headings

Headings from # (H1) through ###### (H6) are supported. Each heading automatically gets an anchor ID for linking.

Lists

Unordered List

Ordered List

  1. First step
  2. Second step
  3. Sub-step 2a
  4. Sub-step 2b
  5. Third step

Blockquotes

This is a blockquote. It can contain formatted text and span multiple lines.

โ€” Author Name

ไปฃ็ ๅ— (Code Blocks)

Python

def greet(name: str) -> str:
"""Generate a greeting message."""
return f"Hello, {name}! Welcome to the book."
if __name__ == "__main__":
message = greet("Reader")
print(message)

JavaScript

function buildTOC(tree, depth = 0) {
const ul = document.createElement("ul");
tree.forEach((node) => {
const li = document.createElement("li");
li.textContent = node.title;
if (node.children) {
li.appendChild(buildTOC(node.children, depth + 1));
}
ul.appendChild(li);
});
return ul;
}

Bash

#!/bin/bash
echo "Building book..."
python scripts/build.py
echo "Done! Output in dist/"

Images

Images use standard Markdown syntax:

![Alt text](path/to/image.png)

Horizontal Rules

Three or more dashes create a horizontal rule:


Escaping

Use backslashes to escape special characters: *not italic*, `not code`.


Next: See advanced features like tables and diagrams.