Syntax Guideline
Complete reference for every feature this blog supports — callouts, diagrams, math, interactive charts, runnable Python, GitHub cards, encrypted posts, and more, all in one place.
Basic Text
Bold, italic, strikethrough, inline code, and links.
Blockquote:
“We don’t write because we want to; we write because we have to.” — and sometimes just so future-me doesn’t have to google it again.
Headings
# H1 — page title (used once)## H2 — main section### H3 — subsection#### H4 — rarely neededLists
Unordered:
- First item
- Second item
- Nested
- Also nested
Ordered:
- Build with Astro
- Push to GitHub
- Auto-deploy via GitHub Actions
Task list:
- Callouts
- Mermaid diagrams
- KaTeX math
- Runnable Python
- Write more posts
Footnotes work too1.
Tables
| Host | Free tier | Edge CDN | Notes |
|---|---|---|---|
| Cloudflare | ✅ | ✅ | Fastest, most generous |
| Vercel | ✅ | ✅ | Great DX |
| GitHub Pages | ✅ | ➖ | Good for static blogs |
Code Blocks
Plain block:
def fib(n): a, b = 0, 1 for _ in range(n): a, b = b, a + b return aWith filename and line highlight:
export function greet(name: string): string { return `Hello, ${name}!`; // highlighted line}Diff block:
export default defineConfig({ output: 'server', output: 'static',});Callouts / Admonitions
Two syntaxes — ::: style:
This is a note. Supports code, italic, and links.
Set any title inside the square brackets.
Something risky lives here.
Don’t forget this.
Deep water — don’t try to parse HTML with regex.
GitHub-flavoured blockquote style:
Works the same as :::note but mirrors GitHub’s own markdown.
Be careful: this can delete data if run against the wrong environment.
Set your environment variables before deploying.
Last chance before something breaks.
Mermaid Diagrams
Flowchart:
flowchart LR
A[Markdown] --> B{remark}
B -->|directive| C[Admonition]
B -->|mermaid| D[Diagram]
B --> E[rehype + KaTeX]
C & D & E --> F[(Static HTML)]Sequence diagram:
sequenceDiagram participant U as Browser participant CDN U->>CDN: GET /blog/a-post CDN-->>U: Static HTML (prebuilt) Note over U,CDN: 0 server runtime
Math (KaTeX)
Inline: the average complexity of quicksort is .
Euler’s identity: .
Block — sigmoid function (used in logistic regression and neural nets):
Gaussian integral:
Interactive Chart
GitHub Repo Cards
Embed a repo with live star/fork counts:
withastro/astroLoading from GitHub… saicaca/fuwariLoading from GitHub…Terminal Recording (Asciinema)
Runnable Python (Pyodide / WASM)
Code blocks with run execute right in the browser — no backend, no server.
First run downloads the Pyodide runtime (~6 MB, cached afterwards).
print("Hello from Python, running in your browser!")
def fib(n):
a, b = 0, 1
for _ in range(n):
a, b = b, a + b
return a
print("First 10 Fibonacci numbers:")
print([fib(i) for i in range(10)])Standard library is included:
import math, statistics
data = [3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5]
print("mean :", round(statistics.mean(data), 3))
print("stdev :", round(statistics.pstdev(data), 3))
print("sqrt 2 :", math.sqrt(2))Errors are caught and displayed — try editing a block to raise one.
Encrypted Posts
Add a password field to any post’s frontmatter:
---title: "Secret notes"description: "..."date: 2026-01-01tags: [private]password: mysecretpassword---At build time, the content is encrypted with AES-GCM (PBKDF2 key derivation, 150 000 iterations). The published HTML contains only ciphertext — the browser decrypts it on the correct password, without any server round-trip.
Footnotes
-
Like this little note at the bottom of the page. ↩
Comments
💬 Giscus is not configured — fill in
repo/repoId/categoryIdinsrc/components/GiscusComments.astro(get them from giscus.app ).