Skip to content

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

sudo apt update && sudo apt install nginx
sudo yum install nginx
sudo pacman -S nginx

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)
setup.sh
#!/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

1
2
3
4
#!/bin/bash
echo "Line 1"
echo "Line 2"
echo "Line 3"

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;
    }
}
  1. This defines an nginx server block
  2. Listen on port 80 for HTTP traffic
  3. 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

  1. First step
  2. Second step
    1. Sub-step 2.1
    2. Sub-step 2.2
  3. 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~~ 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:

\[ T(n) = O(n \log n) \]

Block formula — integral:

\[ \int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi} \]

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.


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:

Custom HTML Block — style anything with raw HTML when Markdown isn't enough.

Images

Linux Tux Penguin — placeholder

Caption: Images support lazy loading and zoom via glightbox


  1. This is the first footnote. ↩

  2. This is a more detailed footnote with formatting support. ↩