Markdown Formatting Showcase

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

Text Formatting

This is bold text and this is italic text. You can also use bold and italic with underscores.

This is bold and italic text.

This is strikethrough text.

This is inline code within a sentence.

This is a link to Google

This is a link with a title

Alt text for an image
Alt text for an image

Lists

Unordered List

  • Item 1
  • Item 2
    • Nested item 2.1
    • Nested item 2.2
      • Deeply nested item
  • Item 3

Ordered List

  1. First item
  2. Second item
    1. Nested item 2.1
    2. Nested item 2.2
  3. Third item

Task List

  • Completed task
  • Incomplete task
  • Another task

Blockquotes

This is a blockquote. It can span multiple lines.

And have multiple paragraphs.

Note: You can use formatting inside blockquotes.

  • Even lists
  • Like this

Code Blocks

JavaScript

function greet(name) {
  console.log(`Hello, ${name}!`);
  return true;
}

const result = greet('World');

Python

def fibonacci(n):
    if n <= 1:
        return n
    return fibonacci(n-1) + fibonacci(n-2)

print(fibonacci(10))

TypeScript

interface User {
  name: string;
  age: number;
}

const user: User = {
  name: 'James',
  age: 20
};

Without syntax highlighting

This is a plain code block
No syntax highlighting
Just monospace text

Tables

Header 1Header 2Header 3
Row 1, Col 1Row 1, Col 2Row 1, Col 3
Row 2, Col 1Row 2, Col 2Row 2, Col 3
Row 3, Col 1Row 3, Col 2Row 3, Col 3

Aligned Tables

Left AlignedCenter AlignedRight Aligned
LeftCenterRight
TextTextText

Horizontal Rules

You can create horizontal rules with three or more hyphens, asterisks, or underscores:




Math (LaTeX)

Inline math: E=mc2E = mc^2

Block math:

ex2dx=π\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}

Matrix example:

[abcd]\begin{bmatrix} a & b \\ c & d \end{bmatrix}

Summation:

i=1ni=n(n+1)2\sum_{i=1}^{n} i = \frac{n(n+1)}{2}

Footnotes

Here’s a sentence with a footnote1.

Here’s another with a longer footnote2.

Definition Lists

Term 1 : Definition 1

Term 2 : Definition 2a : Definition 2b

Escaping Characters

You can escape special characters with a backslash:

*Not italic*

[Not a link]

`Not code`

HTML (if supported)

This is blue text using HTML.
Click to expand

Hidden content goes here!

  • You can use markdown
  • Inside HTML elements

Emojis

:smile: :heart: :rocket: :fire: :tada:

Or use Unicode: 😀 ❤️ 🚀 🔥 🎉

Nested Formatting

Quote with bold

// Code in a quote
const x = 42;
  • List in a quote
  • With multiple items

Line Breaks

This is a line with two spaces at the end
This creates a line break

Or use a backslash
Like this

Abbreviations

The HTML specification is maintained by the W3C.

*[HTML]: Hyper Text Markup Language *[W3C]: World Wide Web Consortium

Comments

Special Blocks (if your theme supports them)

This is a note block

This is a warning block

This is a tip block

This is a danger block

Combining Everything

Here’s a complex example combining multiple features:

Time Complexity: O(logn)O(\log n)

Space Complexity: O(1)O(1)

def binary_search(arr, target):
    """
    Performs binary search on a sorted array.
    
    Args:
        arr: Sorted list of integers
        target: Integer to search for
    
    Returns:
        Index of target if found, -1 otherwise
    """
    left, right = 0, len(arr) - 1
    
    while left <= right:
        mid = (left + right) // 2
        
        if arr[mid] == target:
            return mid
        elif arr[mid] < target:
            left = mid + 1
        else:
            right = mid - 1
    
    return -1

Key Points:

  • Array must be sorted3
  • Uses divide and conquer
  • Very efficient for large datasets

That’s all the formatting options! 🎉

Footnotes

  1. This is the first footnote.

  2. This is a longer footnote with multiple paragraphs.

    You can include code, lists, and other formatting in footnotes.

    print("Hello from a footnote!")
  3. If the array is not sorted, you must sort it first, which takes O(nlogn)O(n \log n) time.