Markdown Feature Showcase¶
This page demonstrates every supported Markdown and MkDocs-Material feature. Use it as a reference when writing documentation.
Admonitions¶
Note
Use for background context and additional information.
Tip
Use for best practices and efficiency suggestions.
Info
Use for informational content that is helpful but not critical.
Warning
Use for potential problems and things to watch out for.
Danger
Use for critical warnings — data loss, security issues.
Success
Use for correct approaches and positive outcomes.
Collapsible question block
This is collapsed by default. Click to expand. Perfect for interview questions and FAQs.
Expanded details block
This is expanded by default. Click to collapse.
Content Tabs¶
Code Blocks¶
With Syntax Highlighting¶
def fibonacci(n: int) -> int:
"""Return the nth Fibonacci number."""
if n <= 1:
return n
return fibonacci(n - 1) + fibonacci(n - 2)
#!/usr/bin/env bash
set -euo pipefail
install_packages() {
local packages=("$@")
apt-get install -y "${packages[@]}"
}
install_packages curl wget git vim
With Line Numbers¶
With Highlighted Lines¶
#!/bin/bash
IMPORTANT_VARIABLE="value" # This line is highlighted
normal_line="other"
ANOTHER_IMPORTANT="line" # This too
With Code Annotations¶
server { # (1)!
listen 80; # (2)!
server_name example.com;
location / { # (3)!
proxy_pass http://localhost:3000;
}
}
- This defines an nginx server block
- Listen on port 80 for HTTP traffic
- All requests are proxied to the local app
Inline Code¶
Use ls -la to list files, or `backtick` for code.
Inline with syntax: print("Hello")
Mermaid Diagrams¶
Flowchart¶
graph LR
A[Start] --> B{Decision}
B -->|Yes| C[Do this]
B -->|No| D[Do that]
C --> E[End]
D --> E
style A fill:#0077b6,color:#fff
style E fill:#06d6a0,color:#0d1117 Sequence Diagram¶
sequenceDiagram
participant C as Client
participant S as Server
participant DB as Database
C->>S: GET /api/users
S->>DB: SELECT * FROM users
DB-->>S: rows[]
S-->>C: JSON response State Diagram¶
stateDiagram-v2
[*] --> NEW
NEW --> READY: fork()
READY --> RUNNING: schedule
RUNNING --> BLOCKED: I/O wait
BLOCKED --> READY: I/O done
RUNNING --> READY: preempt
RUNNING --> TERMINATED: exit()
TERMINATED --> [*] Tables¶
Basic Table¶
| Column 1 | Column 2 | Column 3 |
|---|---|---|
| Value A | Value B | Value C |
| Value D | Value E | Value F |
Aligned Table¶
| Left | Center | Right |
|---|---|---|
| Left-aligned | Centered | Right-aligned |
| data | data | data |
Lists¶
Unordered¶
- Item 1
- Item 2
- Nested item 2.1
- Nested item 2.2
- Item 3
Ordered¶
- First step
- Second step
- Sub-step 2.1
- Sub-step 2.2
- Third step
Task List¶
- Completed task
- Another completed task
- Pending task
- Another pending task
Definition List¶
- Term 1
- Definition of term 1
- Term 2
- Definition of term 2. Can span multiple lines.
Text Formatting¶
| Format | Syntax | Result |
|---|---|---|
| Bold | **text** | text |
| Italic | *text* | text |
| Strikethrough | ~~text~~ | |
| Highlight | ==text== | text |
| Superscript | text^sup^ | textsup |
| Subscript | text~sub~ | textsub |
Keyboard Keys¶
Press Ctrl+C to copy.
Press Ctrl+Alt+T to open terminal.
Use Tab for autocomplete.
Press Esc to cancel.
Mathematical Formulas¶
Inline: The Euler identity is \(e^{i\pi} + 1 = 0\).
Block formula — Big-O notation:
Block formula — integral:
Emoji¶
Linux
Fast
Secure
Hot
Done
Caution
Tip
Blockquotes¶
"Those who do not understand Unix are condemned to reinvent it, poorly."
— Henry Spencer
Nested:
Level 1
Level 2
Level 3
Footnotes¶
This sentence has a footnote.1
Another footnote here.2
Abbreviations¶
The HTML specification is maintained by W3C.
Magic Links¶
GitHub: @Pruthviraj-333
Issue: #42
PR: #123
Critic Markup (Track Changes)¶
Here is some deleted text and inserted text.
Here is some replacedreplacement text.
Here is some highlighted text.
Here is some commented text.
HTML Blocks¶
Raw HTML can be embedded directly:
Images¶
Caption: Images support lazy loading and zoom via glightbox