Feature Playground: runnable code, math, notes, and media

Abstract.

Demonstrates every blog affordance in one place: multi-language run blocks, KaTeX, margin notes/footnotes, images, and Plotly.

Why this exists

This placeholder gathers every blog feature in one spot so you can sanity-check rendering, runnable code, and layout1. It pairs inline math like eiπ+1=0e^{i\pi} + 1 = 0 with margin notes, images, and an interactive Plotly chart for quick visual QA.

Runnable snippets across languages

Code blocks are run at build time to verify their accuracy, allowing for tests and checks. Results are rendered into the page as well. Code that doesn’t compile, run, or pass tests will cause the build of the site to fail.

JavaScript runs in a sandbox during the build, so you can surface small reproducible examples without shipping extra scripts.

const readings = [3, 4, 6, 8];
const average = readings.reduce((sum, n) => sum + n, 0) / readings.length;
console.log("mean reading", average.toFixed(2));

Python is supported too.

from statistics import mean, median

samples = [1, 3, 5, 7, 9]
print(f"mean={mean(samples):.1f}, median={median(samples)}")
assert 1 == 1

Haskell snippets compile and run during the build. Keep them self-contained:

fib :: Int -> Int
fib n
  | n <= 1 = n
  | otherwise = fib (n - 1) + fib (n - 2)

main :: IO ()
main = putStrLn $ "fib 8 = " ++ show (fib 8)

Common Lisp works, too—use SBCL-compatible scripts:


(DEFUN ROLLING-SUM (XS)
  (LET ((SUM 0))
    (MAPCAR (LAMBDA (X) (INCF SUM X) SUM) XS)))

(FORMAT T "Rolling sums: ~{~a~^, ~}~%" (ROLLING-SUM '(1 2 3 4 5)))

Footnotes

Footnotes are rendered automatically at the end of the article.2 Reusing the same footnote is allowed for concise references.2 You can mix margin notes and footnotes without conflicts.

You can call out detours with footnotes3 while keeping the main narrative clean.

Math

Block math renders via KaTeX:

0ex2dx=π2.\int_{0}^{\infty} e^{-x^2} \, dx = \frac{\sqrt{\pi}}{2}.

Images (local + remote)

Three equivalent distributions of phases.
Local figure to test sizing and captions.
Tissot's indicatrix
Tissot's indicatrix: Equal-size circles on the surface of the globe.

Plotly sample chart

Below is a minimal Plotly chart rendered via the helper component. Resize the window to confirm responsiveness.

Markdown preview (rendered samples)

Bold, italics, and inline code all work as expected. Link styles: Marginem home.

Lists

  1. Ordered step
  2. Another step
  3. Final step

Blockquote

“Simplicity is prerequisite for reliability.” — Edsger Dijkstra4

Code fence (static)

git status --short

Table

TermDefinitionSymbol
AlphaFirst letter of the Greek alphabetα\alpha
BetaSecond letter of the Greek alphabetβ\beta
GammaThird letter of the Greek alphabetγ\gamma

Horizontal rule


Use this section as a live visual check for Markdown rendering alongside the runnable snippets and components above.

Footnotes

  1. This post exists solely as a visual and functional checklist.

  2. This demonstrates a dedicated footnote section and repeated references. 2

  3. Footnotes stay inline in the Markdown source but render at the bottom automatically.

  4. Quoted for style verification only.