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

  1. First item
  2. Second item
    1. Sub-item 2a
    2. Sub-item 2b
      1. Deep sub-item
  3. Third item
  1. Ordered item one
    • Unordered nested under ordered
    • Another unordered
      1. Ordered under unordered
  2. 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 title
function greet(name: string): string {
return `Hello, ${name}!`;
}
utils.ts
// Default with title
export function clamp(val: number, min: number, max: number): number {
return Math.min(Math.max(val, min), max);
}
Run dev server
# Terminal with no line numbers
npm install
npm run dev
highlight.ts
// line highlighting
const 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
refactor.ts
// Diff markers β€” EC syntax: del={[lines]} ins={[lines]} in the fence
function 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,
};
rename.ts
class OldService {
fetch() { return new OldService().run(); }
}
const svc = new DataService();
word-highlight.ts
// mark="active" β€” highlights every occurrence of the word 'active' inline
const 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;
long-line.ts
// 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 above
const x = 1;

Code blocks can break out of the content column via wrapper divs β€” same classes as images:

wide-code.ts
// Wide column β€” same extra margin as wide images
export function process(items: Item[], config: ProcessConfig): ProcessResult {
return items.filter(i => i.active).map(i => transform(i, config));
}
bleed-code.ts
// Bleed β€” full width with a small edge gutter; between wide and full
export function process(items: Item[], config: ProcessConfig): ProcessResult {
return items.filter(i => i.active).map(i => transform(i, config));
}
full-code.ts
// 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 ![alt|modifier](url) 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:

Default Image

Image at 400

Image at 459 centered

Image wide

Image bleed

Image full

Image

Douglas Engelbart β€” inventor of the computer mouse (1968)


Tables

Column AColumn BColumn C
Row 1ARow 1BRow 1C
Row 2ARow 2BRow 2C

Alignment

Left-alignedCenter-alignedRight-aligned
AppleCherryBanana
codeboldital
123456789

Wide column table

IDNameRoleDepartmentStart DateStatusNotes
1Alice SmithSenior EngineerPlatform2020-03-01ActiveTeam lead
2Bob JonesDesignerUX2021-07-15ActivePart-time
3Carol WhiteProduct ManagerCore2019-01-10On LeaveReturns Q3
4David BrownQA EngineerPlatform2022-11-01ActiveNight shift

Bleed column table

IDNameRoleDepartmentStart DateStatusNotes
1Alice SmithSenior EngineerPlatform2020-03-01ActiveTeam lead
2Bob JonesDesignerUX2021-07-15ActivePart-time
3Carol WhiteProduct ManagerCore2019-01-10On LeaveReturns Q3
4David BrownQA EngineerPlatform2022-11-01ActiveNight shift

Full wide table

ShortMedium Length ColumnVery Long Column That Stresses Table Layout And Tests Horizontal Scrolling Behaviour In Narrow Containers
ALorem ipsum dolor sit ametThis is an extremely long string meant to push the layout limits of any table container, including nested divs, CSS flexboxes, and responsive designs.
BConsectetur adipiscingA very long paragraph that repeats: Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet.
CShortSupercalifragilisticexpialidocious β€” a very long single word testing overflow handling.

Math

The area of a circle is A=Ο€r2A = \pi r^2. Einstein’s famous equation is E=mc2E = mc^2. Euler’s identity: eiΟ€+1=0e^{i\pi} + 1 = 0

The quadratic formula:

x=βˆ’bΒ±b2βˆ’4ac2ax = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}

Matrix determinant:

∣abcd∣=adβˆ’bc\begin{vmatrix} a & b \\ c & d \end{vmatrix} = ad - bc

Maxwell’s equations (differential form):

βˆ‡β‹…E=ρΡ0,βˆ‡β‹…B=0,βˆ‡Γ—E=βˆ’βˆ‚Bβˆ‚t,βˆ‡Γ—B=ΞΌ0J+ΞΌ0Ξ΅0βˆ‚Eβˆ‚t\nabla \cdot \mathbf{E} = \frac{\rho}{\varepsilon_0}, \quad \nabla \cdot \mathbf{B} = 0, \quad \nabla \times \mathbf{E} = -\frac{\partial \mathbf{B}}{\partial t}, \quad \nabla \times \mathbf{B} = \mu_0 \mathbf{J} + \mu_0\varepsilon_0\frac{\partial \mathbf{E}}{\partial t}

Fourier transform:

f^(ΞΎ)=βˆ«βˆ’βˆžβˆžf(x) eβˆ’2Ο€ixξ dx\hat{f}(\xi) = \int_{-\infty}^{\infty} f(x)\, e^{-2\pi i x \xi}\, dx

Multi-line aligned equations with \begin{align}:

sin⁑2ΞΈ+cos⁑2ΞΈ=1eiΞΈ=cos⁑θ+isin⁑θcosh⁑2xβˆ’sinh⁑2x=1\begin{align} \sin^2\theta + \cos^2\theta &= 1 \\ e^{i\theta} &= \cos\theta + i\sin\theta \\ \cosh^2 x - \sinh^2 x &= 1 \end{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 --> [*] : done

Callouts

All callout types from > [!type] syntax. Unsupported types default to note.

πŸ—’Note General information that is worth drawing attention to.
β„ΉInfo Contextual information for the reader.
πŸ“‹Abstract / Summary / TLDR A quick summary of a longer document or section.
β˜‘Todo Tasks or action items that need to be done.
πŸ’‘Tip / Hint / Important A helpful tip or important note.
βœ…Success / Check / Done Indicates success or completion.
❓Question / Help / FAQ Questions or FAQs.
⚠Warning / Caution / Attention Something that could cause problems.
❌Failure / Fail / Missing Indicates failure or something missing.
πŸ”₯Danger / Error Critical danger or a serious error.
πŸ›Bug A known bug or issue.
πŸ“ŒExample An example or demonstration.
❝Quote / Cite A quotation or citation.
πŸ’‘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
example.ts
function add(a: number, b: number): number {
return a + b;
}
❓Can callouts be nested?
πŸ’‘Yes, they can!
πŸ“ŒEven three levels deep. Use nesting sparingly β€” two levels is usually enough.
πŸ—’Callout with various content Normal paragraph inside a callout.
  • Bullet list inside callout
  • Another item
    • Nested item

  1. Ordered list inside callout
  2. Another ordered item

Inline code and bold and italic all work inside callouts.

Math too: E=mc2E = mc^2

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

token_showcase.c
/* 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
);
}
ts-tokens.ts
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";
}
jsx-tokens.tsx
const el = (
<div className="wrapper" id="root">
<MyComponent title="hello" disabled={false} />
<input type="text" placeholder="…" />
</div>
);

Footnotes

  1. This is the first named footnote. It can contain bold, italic, and inline code. ↩

  2. This is the second footnote. Continuation lines indented with 4 spaces are part of the same footnote. You can even have multiple paragraphs.

    Second paragraph of the footnote. ↩