Code, tables and notes
https://blog.kiarashs.ir/blog/code-tables-and-notes
Contents14 sections
Fenced code is highlighted at build time by highlight.js. The token colours are defined against the site's CSS variables rather than copied from a vendor theme, so light and dark stay consistent with everything else on the page.
import numpy as np
def bootstrap_se(sample, statistic, replicates=2000, seed=0):
"""Standard error of `statistic` under resampling with replacement."""
rng = np.random.default_rng(seed)
draws = rng.choice(sample, size=(replicates, sample.size), replace=True)
return np.std([statistic(row) for row in draws], ddof=1)fit <- lm(mpg ~ wt + factor(cyl), data = mtcars)
summary(fit)$coefficients[, c("Estimate", "Std. Error")]The language and the copy button sit in a bar above each block, and every line is numbered. The numbers come from a CSS counter, so copying the block gives the code and nothing else. An unknown language is left unhighlighted rather than guessed at, because a wrong guess colours the wrong tokens and reads worse than plain text.
Figures
An image on its own line becomes a figure. The quoted title after the path is the caption:
The build reads the file to set width and height, so the page does not
reflow as figures load, and adds loading="lazy". Put images in public/
and reference them from the root, as above; the deployment's base path is
added at build time. If a name.dark.ext sibling exists — as it does here —
it is used when the reader is on the dark theme, which saves white-background
plots from glaring out of a dark page.
Video
An image whose path is a video is a player instead, numbered and captioned like any other figure:

Caption: Ten seconds at the start, sped up.A YouTube link works the same way:

Nothing is asked of YouTube until the reader clicks: the build draws the
video's own still with a play badge over it, and the player replaces it on the
click. With JavaScript off the still is a link to the video on YouTube. The
embed goes to youtube-nocookie.com, and a ?t= in the link you paste is kept,
so a link copied at a particular moment starts there.
Raw <video> HTML on its own line still works if you want the attributes.
Captions
Any block can be captioned by following it with a paragraph that starts with
Caption:. Figures, tables, listings and notebooks are each numbered in their
own sequence, the way a paper numbers them, and the numbering is done at build
time so it survives with JavaScript off. Images can use the Markdown title
instead, which comes to the same thing. A caption sits below a figure and above
anything read from the top down: a table, a listing, a notebook.
Tables
Wide tables scroll inside their own box instead of pushing the page sideways. A table's caption goes above it, as in a journal.
npm run build, in the order they run. | Stage | What it does |
|---|---|
render-diagrams | Mermaid to SVG, light and dark |
tsc --noEmit | Type-checks the code |
vite build | Client bundle |
vite build --ssr | Server bundle |
render-cards | A social-card image for each post |
render-avatar | The front page's portrait, resized |
prerender | One HTML file per route, plus feeds and sitemap |
Notebooks
A fence tagged notebook whose body is a path under public/ embeds the
notebook: markdown cells become prose, code cells keep their execution counts,
and outputs come through — text, tables, images and errors alike.
```notebook
/posts/code-tables-and-notes/sampling.ipynb
```Which gives, with #invert after the path so the plot's white paper turns
dark on the dark theme, as #invert does for a figure:
.ipynb stays in public/, so
readers can download the original. Sampling the estimator
The variance we expect is ; the point of the cell below is to see whether the simulation agrees.
import numpy as np
rng = np.random.default_rng(20260904)
draws = rng.normal(size=(6, 2000))
means = draws.mean(axis=1)
print(f"observed sd: {means.std(ddof=1):.5f}")
print(f"expected sd: {1 / np.sqrt(2000):.5f}")observed sd: 0.02244 expected sd: 0.02236
counts, _ = np.histogram(means, bins=6)
countsarray([1, 1, 1, 2, 1, 0])
import matplotlib.pyplot as plt
plt.bar(range(len(counts)), counts)
plt.show()means[99]Traceback (most recent call last): Cell In[4], line 1 IndexError: index 99 is out of bounds for axis 0 with size 6
The notebook is read at build time, so nothing about Jupyter reaches the browser: no widgets, no kernel, no JavaScript beyond what the rest of the page already loads.
Footnotes and lists
Footnotes collect at the foot of the post with a link back to where they were referenced.11 The pipeline is remark-parse, remark-gfm, the emoji step, remark-math, remark-rehype, then rehype-raw, rehype-slug, the alert step, rehype-citation, the notebook and diagram steps, rehype-highlight, equation numbering, rehype-katex and finally the figure and caption steps. Order matters: raw HTML is parsed first, notebooks and diagrams are expanded before the highlighter sees them, and captions are numbered last, once every block that can take one exists. Task lists render as checkboxes:
- Prerendered HTML for every route
- Feed and sitemap
- Whatever you add next
Inline formatting
The usual emphasis works, bold, italic and both, and so does
struck-out text, set quieter than the sentence around it. HTML fills in
where Markdown has no syntax: a highlight, a key such as
Ctrl+C, H2O and x2.
A colour written as inline code gets a swatch of itself: #c0573e,
rgb(46 125 50), hsl(210, 60%, 45%), and a translucent one, #1565c080,
over a checkerboard. Only a code span holding the colour and nothing else
counts, so color: #c0573e stays as written.
Another typeface
Two other faces can set a passage: EB Garamond, a revival of the sixteenth-century
roman of Claude Garamond, and Libertinus Serif, the maintained fork of Linux
Libertine, which ACM's paper template is set in. Put font= on any HTML
element, with blank lines inside a block so Markdown keeps working:
<div font="garamond">
A passage in EB Garamond, with *italic*, **bold** and the figures 1625.
</div>A passage in EB Garamond, with italic, bold and the figures 1625. The
face is scaled to sit beside the text around it, so the passage changes its
letters and not its size. Code stays monospace and maths stays .
The same in Libertinus Serif, with italic, bold and the figures 1625. It is narrower than the body face and looks like the page of a paper.
Inline, <span font="libertinus">a few words</span> sets
a few words in it. font: garamond in the
frontmatter sets a whole post, title included. A name the site does not have
leaves the text in the body face, and the build says which names it has. A
face is downloaded only by a page that uses it.
Definitions and abbreviations
A term on its line and its definition on the next, after a colon, make a definition list:
Prior
: What you believe about a parameter before seeing the data.
Likelihood
: How probable the data are, for each value the parameter could take.
Posterior
Updated belief
: The prior, reweighted by the likelihood: what the data leave you believing.- Prior
- What you believe about a parameter before seeing the data.
- Likelihood
- How probable the data are, for each value the parameter could take.
- Posterior
- Updated belief
- The prior, reweighted by the likelihood: what the data leave you believing.
Two terms in a row share the definition after them, as the last pair does.
<dl>, <dt> and <dd> written as HTML come out the same.
An abbreviation is defined once, on a line of its own anywhere in the post:
*[MCMC]: Markov chain Monte Carlo
The line is not shown, and every Markov chain Monte Carlo (MCMC) after it is marked, with the full name when the pointer rests on it. A phone has no pointer to rest, so the first use is spelled out where it stands, as on paper: a sampler built on MCMC draws from the posterior, and every later MCMC is marked but not spelled out again.
Collapsible sections
A collapsible section
Write it in HTML, with a blank line after the <summary> and another before
</details>, and Markdown works inside: bold, a list, a code block.
One inside it
A section inside another is a box inside the first, so the nesting shows.
Emoji
GitHub's shortcodes work, in prose and in the frontmatter both: :rocket: is
🚀, :+1: is 👍, and the names are the ones GitHub publishes, all 1,913 of
them. They are resolved when the post is compiled, so the table of names never
reaches a reader's browser and the character in the HTML is the character they
get.
A shortcode inside code or a fence is left alone, which is why this paragraph
can print one. Two things worth knowing: a pair of colons around a name nothing
recognises stays exactly as written, so 12:30:45 and a Note: at the start of
a line are safe; and the very short names are real, so :x: is ❌ rather than a
letter between colons.
Mermaid
Alerts
GitHub's alert syntax works here. A blockquote whose first line is one of five markers becomes a callout:
> [!NOTE]
> **Key Takeaway:** Self-supervised learning can reduce the need for labelled
> IMU data.Note
Key Takeaway: Self-supervised learning can reduce the need for labelled IMU data.
Tip
Helpful advice for doing something better or more easily.
Important
Essential information needed to succeed.
Warning
Something that could cause problems if ignored.
Caution
Describes potential negative consequences.
The marker is matched case-insensitively, and an alert holds whatever a blockquote holds — several paragraphs, a list, a code fence, a citation. Any blockquote without one of the five markers stays a blockquote, because a quotation is still a quotation.
The reason to borrow GitHub's syntax rather than invent one is that it degrades into something readable. Paste the source into a plain Markdown viewer, or read it as a diff, and you still get a blockquote with its label on the first line. Nothing is lost but the colour.
Several authors
This post lists two. Each gets a byline with their affiliation at the top, a card at the bottom, and their own page listing everything they have written.
Footnotes
-
The pipeline is remark-parse, remark-gfm, the emoji step, remark-math, remark-rehype, then rehype-raw, rehype-slug, the alert step, rehype-citation, the notebook and diagram steps, rehype-highlight, equation numbering, rehype-katex and finally the figure and caption steps. Order matters: raw HTML is parsed first, notebooks and diagrams are expanded before the highlighter sees them, and captions are numbered last, once every block that can take one exists. ↩
Cite this post
@misc{soleimanzadeh2026code,
author = {Soleimanzadeh, Kiarash and Name, Co-author},
title = {Code, tables and notes},
year = {2026},
url = {https://blog.kiarashs.ir/blog/code-tables-and-notes},
urldate = {2026-09-03},
doi = {10.5281/zenodo.123}
}Soleimanzadeh, K., & Name, C. (2026, September 3). Code, tables and notes. Kiarash Soleimanzadeh. https://doi.org/10.5281/zenodo.123K. Soleimanzadeh and C. Name, "Code, tables and notes," Kiarash Soleimanzadeh, Sept. 3, 2026. [Online]. Available: https://blog.kiarashs.ir/blog/code-tables-and-notes. doi: 10.5281/zenodo.123Kiarash Soleimanzadeh, Co-author Name. “Code, tables and notes.” Kiarash Soleimanzadeh, 3 September 2026. https://blog.kiarashs.ir/blog/code-tables-and-notes (doi:10.5281/zenodo.123)
Comments