Blog
中文

MDX Component Showcase

Demonstrating all available MDX components and features in the blog

1 min read

This post demonstrates all available MDX components in the blog for easy reference.

Callout Boxes

Academic Components

Definition

定义

Let f(x)f(x) be defined on some open interval containing aa, except possibly at aa itself. Then we say that the limit of f(x)f(x) as xx approaches aa is LL, and write limxaf(x)=L\lim_{x \to a} f(x) = L, if for every number ϵ>0\epsilon > 0 there is a number δ>0\delta > 0 such that if 0<xa<δ0 < |x - a| < \delta then f(x)L<ϵ|f(x) - L| < \epsilon.

Theorem

定理 (Fermat's Last Theorem)

No three positive integers aa, bb, and cc satisfy the equation an+bn=cna^n + b^n = c^n for any integer value of nn greater than 2.

Proof

证明

The proof is too complex to include here. This theorem was proven by Andrew Wiles in 1995.

Mathematics

Inline Math

Einstein’s mass-energy equivalence E=mc2E = mc^2 reveals the relationship between mass and energy.

Block Math

Maxwell’s equations (differential form):

E=ρϵ0B=0×E=Bt×B=μ0J+μ0ϵ0Et\begin{aligned} \nabla \cdot \mathbf{E} &= \frac{\rho}{\epsilon_0} \\ \nabla \cdot \mathbf{B} &= 0 \\ \nabla \times \mathbf{E} &= -\frac{\partial \mathbf{B}}{\partial t} \\ \nabla \times \mathbf{B} &= \mu_0 \mathbf{J} + \mu_0 \epsilon_0 \frac{\partial \mathbf{E}}{\partial t} \end{aligned}

Code Highlighting

Basic Code Block

def fibonacci(n: int) -> int:
    """Calculate the nth Fibonacci number"""
    if n <= 1:
        return n
    return fibonacci(n - 1) + fibonacci(n - 2)

# Test
for i in range(10):
    print(f"F({i}) = {fibonacci(i)}")

Code Block with Line Numbers

interface User {
  id: number;
  name: string;
  email: string;
  createdAt: Date;
}

function createUser(name: string, email: string): User {
  return {
    id: Math.random(),
    name,
    email,
    createdAt: new Date()
  };
}

Code Diff

Pseudocode

QuickSort Algorithm

Tabs

// JavaScript example
const sum = (a, b) => a + b;
console.log(sum(1, 2)); // 3
# Python example
def sum(a, b):
    return a + b
print(sum(1, 2))  # 3
// Go example
func sum(a, b int) int {
    return a + b
}
fmt.Println(sum(1, 2)) // 3

Collapsible Content (Details)

Click to expand for more content

This is hidden detailed content. It can contain any Markdown content, including code blocks, lists, etc.

  • Item 1
  • Item 2
  • Item 3
console.log('Hidden code');
This is expanded by default

This collapsible block is expanded by default.

Chart Components

Chart.js

ECharts

Vega-Lite

Plotly

Diagrams

Mermaid Flowchart

Sequence Diagram

Typograms (ASCII Diagrams)

Maps (GeoMap)

Media Components

Figure

Mountain landscape
Majestic mountain scenery

Photo Grid

Video

Big Buck Bunny sample video

Audio

Sample Audio

Tables

Basic Table

LanguageType SystemPrimary Use
TypeScriptStaticWeb Frontend/Backend
PythonDynamicData Science/Scripting
RustStaticSystems Programming
GoStaticBackend Services

Blockquote

Simplicity is the ultimate sophistication.

— Leonardo da Vinci

Footnotes

This is a sentence with a footnote1.

Task List

  • Create components
  • Write documentation
  • Add tests
  • Deploy

Summary

This post showcased all available MDX components in the blog. You can use these components in your own articles to enrich your content presentation.

Footnotes

  1. This is the footnote content.

Share

Related Posts

Comments