| title | description | author | date | categories | tags | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Markdown Syntax Showcase |
A comprehensive example of Markdown syntax supported by mdast. |
Mayank Chaudhari |
2025-03-03 |
|
|
- Basic Elements
- Lists
- Code Blocks
- Tables
- Links and Images
- Task Lists
- Footnotes
- Emoji
- Math Equations
- Diagrams
- Definition Lists
- Admonitions
- HTML Elements
- Custom Directives
Different levels of headings for structuring content.
The largest heading, usually reserved for the main title of the document. By default, single # in markdown is converted to Title. Thus, 'Heading 2', which in markdown is ## Heading 2 will have Heading 1 style applied, unless you set useTitle to false in the sectionProps.
A subheading, used to separate major sections.
A smaller heading, often used for subsections.
A more detailed subsection heading.
A minor heading, used for further breakdown.
The smallest heading, typically used for fine details.
- List inside a blockquote:
- Bold Text inside a list
Inline Codeinside a listconsole.log("Code inside a blockquote list");
- Bold text
with code - Italic text
StrikethroughInline code
This is a nested blockquote example.
Another level of nesting.
- List item 1
- List item 2
- Subitem inside blockquote
def nested_function(): return "Code inside nested blockquote"
- Item 1
- Item 2
- Subitem 1
- Subitem 2
- Item 3
- First item
- Second item
- Subitem 1
- Subitem 2
- Third item
function greet(name) {
console.log(`Hello, ${name}!`);
}
greet("Mayank");def greet(name):
print(f"Hello, {name}!")
greet("Mayank")Structuring data in tabular format.
| Name | Age | Location |
|---|---|---|
| John | 25 | New York |
| Alice | 30 | San Francisco |
| Bob | 28 | London |
| Left-aligned | Center-aligned | Right-aligned |
|---|---|---|
| Text 1 | Text 2 | Text 3 |
Adding hyperlinks and images.
Embedding images in Markdown.
SVG:
PNG:
Data URL:
This is an example of using reference-style links in Markdown.
You can define a reference link like this
OpenAI is an AI research and deployment company.
Markdown syntax is explained in detail on Markdown Guide.
Checkable task lists.
- Task 1 - Completed
- Task 2 - Pending
- Task 3 - Pending
- Subtask 3.1 - Done
- Subtask 3.2 - Pending
- Task 4 - In Progress
- Task 5 - Pending Review
- Task 6 - Approved
Task lists are useful for tracking progress in projects.
Referencing additional information.
Here is a statement with a footnote.1
Using emojis in Markdown.
😄 🚀 🎉 🔥 💻
Displaying mathematical expressions.
Inline equation:
Block equation:
Inline math expressions can be enclosed within single dollar signs: \\( and \\):
Display math expressions are enclosed within double dollar signs, which renders them on their own line:
You can also use \\[ and \\]:
Here are some common mathematical symbols:
- Greek letters:
$\alpha$ ,$\beta$ ,$\gamma$ ,$\Gamma$ ,$\Delta$ ,$\pi$ ,$\Pi$ ,$\Sigma$ ,$\omega$ ,$\Omega$ - Superscripts and subscripts:
$x^2$ ,$y_i$ ,$a^{b+c}$ ,$e^{-i\omega t}$ - Fractions:
$\frac{1}{2}$ ,$\frac{x+y}{z}$ - Square roots:
$\sqrt{x}$ ,$\sqrt[3]{y}$ - Summations and products:
$\sum_{i=1}^n i$ ,$\prod_{j=1}^m j$ - Integrals:
$\int_a^b f(x) dx$ ,$\oint_C \vec{F} \cdot d\vec{r}$ - Limits:
$\lim_{x \to \infty} \frac{1}{x}$ - Vectors:
$\vec{v}$ ,$\mathbf{v}$ - Matrices: $\begin{pmatrix} a & b \ c & d \end{pmatrix}$
- Partial derivatives:
$\frac{\partial f}{\partial x}$ - Infinity:
$\infty$ - Logical symbols:
$\forall$ ,$\exists$ ,$\in$ ,$\notin$ ,$\subseteq$ ,$\supseteq$ ,$\land$ ,$\lor$ ,$\neg$ - Trigonometric functions:
$\sin(x)$ ,$\cos(y)$ ,$\tan(z)$ - Exponential and logarithmic functions:
$e^x$ ,$\ln(y)$ ,$\log_{10}(z)$
Matrices can be created using the pmatrix, bmatrix, vmatrix, and Vmatrix environments:
You can align equations using the align environment:
You can also use aligned for aligning parts of an equation:
Case statements can be created using the cases environment:
You can include text within math expressions using the \text{} command:
You can color math expressions using the \textcolor{color}{math} command:
You can define custom macros:
\newcommand{\norm}[1]{\left\lVert#1\right\rVert}Visualizing data with diagrams.
graph TD;
A-->B;
A-->C;
B-->D;
C-->D;
sequenceDiagram
participant A
participant B
A->>B: Hello, how are you?
B->>A: I'm good, thanks!
- Root
- Branch 1
- Subbranch 1
- Subbranch 2
- Branch 2
- Subbranch 3
- Subbranch 4
gantt
title Project Timeline
dateFormat YYYY-MM-DD
section Development
Task 1 :done, 2024-01-01, 2024-01-10
Task 2 :active, 2024-01-11, 2024-01-20
Task 3 : 2024-01-21, 2024-01-30
Defining terms and meanings.
Term 1
: Definition 1
Term 2
: Definition 2a
: Definition 2b
Highlighting important notes or warnings.
Note: This is an important note.
Warning: Be careful with this step!
Using HTML for additional interactivity.
Click to expand
This is hidden content.This is a checkbox -
This is an example of inline HTML inside a paragraph:
This is a red bold text inside a Markdown paragraph.
You can also add inline images:
Or create inline links with styles:
Inside pre tag
Indentation and formatting etc. here should be preserved.
Hmmm...
| Name | Age | Location |
|---|---|---|
| John | 25 | New York |
| Alice | 30 | San Francisco |
Email:
<style> table { border-collapse: collapse; width: 100%; } th, td { border: 1px solid black; padding: 8px; text-align: left; } th { background-color: #f2f2f2; } </style>This is a blockquote with an embedded HTML table:
Feature Supported Markdown ✅ HTML ✅
Embedding custom components.
<MyComponent title="Hello World" />This document covers most of the syntax supported by mdast, including extended Markdown features such as GFM, math, diagrams, and MDX components.
Footnotes
-
This is the footnote content. ↩
