Markdown Test
Astro MDX Markdown test file.
This note is a living reference for every element you can place in a .mdx note. Features come from: standard CommonMark, GitHub Flavored Markdown (GFM), KaTeX (math), Expressive Code (code blocks), and the siteβs custom plugins (highlights, callouts, image sizing, mermaid).
Headings #
Heading 2 β H2 #
Heading 3 β H3 #
Heading 4 β H4 #
Heading 5 β H5 #
Heading 6 β H6 #
Text #
Plain paragraph text is the baseline. Bold β **text** Italic β *text* Strikethrough β ~~text~~ Highlight β ==text== (custom plugin) Underline β <u>text</u> (HTML element) Strike via HTML β <s>text</s> subscript and superscript β <sub> / <sup>. Underline with bold and italic and highlight nested. Inline code β backtick (not styled by text modifiers). Ctrl+Shift+P β keyboard keys via <kbd>. HTML β abbreviation with tooltip via <abbr title="...">. Markdown internal link: Rust β [text](relative-path). External link: Astro docs β [text](url). Bare URL (use a markdown link): https://example.com β [url](url). Named footnote reference: see footnote[^named] for details. Internal anchor link: Jump to Tables β [text](#heading-id) navigates to any heading on the same page.
A simple blockquote. Good for citations or callouts without icons.
Nested blockquotes:
First level of nesting.
Second level of nesting.
Lists #
- This is a List
- Create with dash, asterisk or plus sign.
- Nested B1
- Nested B2
- Deeply nested B2a
- Deeply nested B2b
- Item C
- First item
- Second item
- Sub-item 2a
- Sub-item 2b
- Deep sub-item
- Third item
- Completed task
- Incomplete task
- Another completed task
- Completed subtask
- Incomplete subtask
- Task with bold text
- Ordered item one
- Unordered nested under ordered
- Another unordered
- Ordered under unordered
- Ordered item two
- Task nested under ordered
- Completed task nested under ordered
- Deeper unordered under task
Code Blocks #
Use const x = 1 for variable declarations. Press Ctrl+` to open the terminal.
// Default, line numbers and no titlefunction greet(name: string): string { return `Hello, ${name}!`;}// Default with titleexport function clamp(val: number, min: number, max: number): number { return Math.min(Math.max(val, min), max);}# Terminal with no line numbersnpm installnpm run dev// line highlightingconst API_URL = "https://api.example.com"; // line 1 highlighted
function fetchData(endpoint: string) { const url = `${API_URL}/${endpoint}`; // line 4 highlighted return fetch(url).then(r => r.json()); // line 5 highlighted} // line 6 highlighted// Diff markers β EC syntax: del={[lines]} ins={[lines]} in the fencefunction oldImplementation(x: number) { return x * x * x;}function cube(x: number): number { return x ** 3;}--- a/src/config.ts+++ b/src/config.ts@@ -2,5 +2,6 @@ export const config = { host: "localhost",- port: 3000,+ port: 8080,+ debug: true, };class OldService { fetch() { return new OldService().run(); }}const svc = new DataService();// mark="active" β highlights every occurrence of the word 'active' inlineconst results = items.filter(item => item.active && item.score > 0.5);if (results.filter(r => r.active).length > 0) return true;// Force no line numbers (showLineNumbers=false)const x = 1;const y = 2;// Wrap long lines (wrap)const veryLongVariableName = someObject.someMethod().chainedMethod().anotherChainedMethod().finalMethod("with a very long argument string");// frame="none" β the title tab above is suppressed; compare with "utils.ts" block aboveconst x = 1;Code blocks can break out of the content column via wrapper divs β same classes as images:
// Wide column β same extra margin as wide imagesexport function process(items: Item[], config: ProcessConfig): ProcessResult { return items.filter(i => i.active).map(i => transform(i, config));}// Bleed β full width with a small edge gutter; between wide and fullexport function process(items: Item[], config: ProcessConfig): ProcessResult { return items.filter(i => i.active).map(i => transform(i, config));}// Full page width β edge to edge (padding applied inline via style to prevent clipping)export function process(items: Item[], config: ProcessConfig): ProcessResult { return items.filter(i => i.active).map(i => transform(i, config));}Images #
Images use the  syntax. Modifiers after | are space-separated and combinable β e.g. |400 center. Below: default, 400px, centered at 450px, wide, bleed (between wide and full), full, and a captioned figure via HTML:
Douglas Engelbart β inventor of the computer mouse (1968)
Tables #
| Column A | Column B | Column C |
|---|---|---|
| Row 1A | Row 1B | Row 1C |
| Row 2A | Row 2B | Row 2C |
Alignment
| Left-aligned | Center-aligned | Right-aligned |
|---|---|---|
| Apple | Cherry | Banana |
code | bold | ital |
| 123 | 456 | 789 |
Wide column table
| ID | Name | Role | Department | Start Date | Status | Notes |
|---|---|---|---|---|---|---|
| 1 | Alice Smith | Senior Engineer | Platform | 2020-03-01 | Active | Team lead |
| 2 | Bob Jones | Designer | UX | 2021-07-15 | Active | Part-time |
| 3 | Carol White | Product Manager | Core | 2019-01-10 | On Leave | Returns Q3 |
| 4 | David Brown | QA Engineer | Platform | 2022-11-01 | Active | Night shift |
Bleed column table
| ID | Name | Role | Department | Start Date | Status | Notes |
|---|---|---|---|---|---|---|
| 1 | Alice Smith | Senior Engineer | Platform | 2020-03-01 | Active | Team lead |
| 2 | Bob Jones | Designer | UX | 2021-07-15 | Active | Part-time |
| 3 | Carol White | Product Manager | Core | 2019-01-10 | On Leave | Returns Q3 |
| 4 | David Brown | QA Engineer | Platform | 2022-11-01 | Active | Night shift |
Full wide table
| Short | Medium Length Column | Very Long Column That Stresses Table Layout And Tests Horizontal Scrolling Behaviour In Narrow Containers |
|---|---|---|
| A | Lorem ipsum dolor sit amet | This is an extremely long string meant to push the layout limits of any table container, including nested divs, CSS flexboxes, and responsive designs. |
| B | Consectetur adipiscing | A very long paragraph that repeats: Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. |
| C | Short | Supercalifragilisticexpialidocious β a very long single word testing overflow handling. |
Math #
The area of a circle is . Einsteinβs famous equation is . Eulerβs identity:
The quadratic formula:
Matrix determinant:
Maxwellβs equations (differential form):
Fourier transform:
Multi-line aligned equations with \begin{align}:
Graphs (Mermaid) #
Mermaid renders client-side from CDN and re-renders on theme toggle.
stateDiagram-v2
[*] --> Idle
Idle --> Loading : fetch()
Loading --> Success : 200 OK
Loading --> Error : 4xx/5xx
Error --> Idle : retry
Success --> Idle : reset
Success --> [*] : doneCallouts #
All callout types from > [!type] syntax. Unsupported types default to note.
Foldable tip, open by default
Click to collapse The + start expanded.
You can put any content here: lists, code, tables, nested callouts.
Foldable warning, collapsed by default
This content is hidden until expand it. The - start collapsed.
Click to see a code example
function add(a: number, b: number): number { return a + b;}- Bullet list inside callout
- Another item
-
Nested item
-
- Ordered list inside callout
- Another ordered item
Inline code and bold and italic all work inside callouts.
Math too:
Click to expand native HTML details element
This content is hidden by default. Unlike callouts, this uses the browserβs built-in <details>/<summary> elements.
You can put any content here, including bold, italic, lists, and even code:
const secret = "hidden until expanded";Inline MDX comment:
This content is in a <div class="wide"> with custom CSS inline styles. It breaks out into the wide layout column and has a subtle background that matches the siteβs design tokens.
Footnotes #
Named footnotes are defined anywhere in the document and rendered at the bottom.1 Here Iβm inserting two references. 2
Code Colors #
/* block comment */// line comment
#include <stdio.h>
#define PI 3.14159265358979#define CONCAT(a, b) a##b#define CLAMP(v,lo,hi) (((v)<(lo))?(lo):(((v)>(hi))?(hi):(v)))
typedef enum { STATUS_IDLE = 0,} Status;
typedef struct Node { const char *label;} Node;
static inline int32_t clamp_i32(int32_t val, int32_t lo, int32_t hi);void arena_free(Arena *a);
static inline int32_t clamp_i32(int32_t val, int32_t lo) { return val < lo ? lo : (val > hi ? hi : val);}
int main(int argc, char *argv[]) { int decimal = 42; unsigned int udecimal = 42u; int hex = 0xDEADBEEF; const char *greeting = "Hello, World!\n"; head->id = 42; int node_id = stack_node.id; printf(fmt, arith, pi_d); fprintf(stderr, "argc = %d\n", argc); size_t sz_node = sizeof(Node); int final = CLAMP( (int)((double)arith * PI + (float)shift / (decimal + 1.0f)), -(MAX_ITEMS), MAX_ITEMS );}const msg = `Hello ${name}, score: ${score.toFixed(2)}`;const raw = "plain string literal";
const re = /^[a-z_]\w*$/i;const ok = true;const none = null;
class Counter { count = 0; inc() { this.count++; }}
import { readFile } from 'fs/promises';export default Counter;
function log(target: any, key: string) {}class Service { @log name = "svc";}const el = ( <div className="wrapper" id="root"> <MyComponent title="hello" disabled={false} /> <input type="text" placeholder="β¦" /> </div>);