Markdown Features Demo π
This page demonstrates ALL the Markdown features available in Docusaurus.
Table of Contentsβ
- Basic Text Formatting
- Headers
- Lists
- Links and Images
- Code Blocks
- Tables
- Admonitions
- Math Equations
- Mermaid Diagrams
- HTML Elements
Basic Text Formattingβ
Bold text and italic text and bold italic text
Strikethrough text
Inline code with backticks
Blockquote example
Multiple lines in blockquote
Horizontal rule below:
Headersβ
This is H3β
This is H4β
This is H5β
This is H6β
Listsβ
Unordered Listsβ
- Item 1
- Item 2
- Nested item 2.1
- Nested item 2.2
- Double nested item 2.2.1
- Item 3
Ordered Listsβ
- First item
- Second item
- Nested numbered item
- Another nested item
- Third item
Task Listsβ
- Completed task
- Incomplete task
- Another completed task
Links and Imagesβ
Linksβ
Imagesβ
Code Blocksβ
Basic Code Blockβ
Plain text code block
No syntax highlighting
JavaScript with Syntax Highlightingβ
function greetUser(name) {
console.log(`Hello, ${name}!`);
return `Welcome ${name}`;
}
greetUser("World");
Code Block with Titleβ
def fibonacci(n):
if n <= 1:
return n
return fibonacci(n-1) + fibonacci(n-2)
# Calculate fibonacci sequence
for i in range(10):
print(f"F({i}) = {fibonacci(i)}")
Code Block with Line Numbersβ
import React from 'react';
function WelcomeComponent({ name }) {
return (
<div className="welcome">
<h1>Welcome {name}!</h1>
<p>This is a React component</p>
</div>
);
}
export default WelcomeComponent;
Code Block with Line Highlightingβ
# Install Docusaurus
npm create docusaurus@latest my-website classic
cd my-website
npm start
# Your site starts at http://localhost:3000
# Edit docs/intro.md and save to reload
Code Block with Comments Highlightingβ
interface User {
id: number;
name: string;
email: string;
}
function createUser(userData: Partial<User>): User {
return {
id: Math.random(),
name: userData.name || 'Anonymous',
email: userData.email || 'no-email@example.com'
};
}
const newUser = createUser({ name: 'John Doe' });
Tablesβ
| Feature | Supported | Notes |
|---|---|---|
| Markdown | β | Full support |
| MDX | β | With React components |
| Math | β | KaTeX support |
| Mermaid | β | Diagram support |
| Syntax Highlighting | β | Prism.js |
Advanced Tableβ
| Left Aligned | Center Aligned | Right Aligned |
|---|---|---|
| Item 1 | Item 2 | Item 3 |
| Bold | Italic | Code |
| Link | 123 |
Admonitionsβ
This is a note admonition. It's useful for general information.
This is a tip admonition with a custom title. Use it for helpful advice!
This is an info admonition. Great for additional context.
This is a warning admonition. Use it to alert users about important considerations.
This is a danger admonition with custom title. Use it for critical warnings!
Nested Admonitionsβ
This tip contains a nested warning:
Be careful when using nested admonitions!
And you can use markdown inside admonitions:
- Lists work
- Formatting works
Codeworks- Links work
:::
Math Equationsβ
Inline Mathβ
The quadratic formula is x = \frac{-b \pm \sqrt{b^2-4ac}}{2a}
Block Mathβ
\int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}More Complex Equationsβ
\begin{aligned} \nabla \times \vec{\mathbf{B}} -\, \frac{1}{c}\, \frac{\partial\vec{\mathbf{E}}}{\partial t} &= \frac{4\pi}{c}\vec{\mathbf{j}} \\ \nabla \cdot \vec{\mathbf{E}} &= 4 \pi \rho \\ \nabla \times \vec{\mathbf{E}}\, +\, \frac{1}{c}\, \frac{\partial\vec{\mathbf{B}}}{\partial t} &= \vec{\mathbf{0}} \\ \nabla \cdot \vec{\mathbf{B}} &= 0 \end{aligned}Mermaid Diagramsβ
Flowchartβ
Sequence Diagramβ
Gantt Chartβ
HTML Elementsβ
Details and Summaryβ
Click to expand
This content is hidden by default and can be revealed by clicking the summary.
- You can use markdown inside details
- Including lists
- And
code
console.log("Even code blocks work!");
Custom HTMLβ
Custom Styled Box
This is a custom HTML div with inline styles.
You can mix HTML and Markdown freely!
Keyboard Keysβ
Press Ctrl + C to copy text.
Use β + Space on Mac to open Spotlight.
Abbreviationsβ
The HTML specification is maintained by the W3C.
HTML stands for HyperText Markup Language. W3C stands for World Wide Web Consortium.
Conclusionβ
This page demonstrates all the core Markdown features available in Docusaurus. The next step is to explore MDX features that allow you to embed React components directly in your content!
Next: Check out the MDX + React Demo to see advanced features in action.