Repository navigation
Releases
v267.9.0 — SVG listing with --include-svg
SVGs were only ever visible as images referenced from markdown. With
--include-svg they become first-class citizens of the preview: tracked,
listed in the sidebar, and opened as a wrapper page like PDFs — while plain
markdown embedding () keeps working unchanged.
Added
--include-svgflag. Tracks.svgfiles in directory mode; a single
.svgpath is accepted in single-file mode without the flag. Clicking one
renders a centered image over the raw bytes inside the regular shell —
sidebar, themes, source view and live reload behave like a markdown page
(the SVG text feeds the source view).?raw=1serves the raw bytes with
Content-Disposition: inlineand an mtime-based ETag (If-None-Match →
304).- Markdown embedding keeps working. An
<img>inside markdown
advertisesimage/svg+xmlin its Accept header; a top-level navigation
does not. Tracked files still serve raw bytes to image requests instead
of the wrapper page, sorenders identically whether
or not the file is tracked. Untracked SVGs serve as plain images from
disk as before.
Fixed
- Watcher events for image files are now filtered to writes and removals.
Read activity from serving a tracked SVG used to trigger a refresh,
which re-read the file, which triggered the next refresh — an endless
loop per request.
v267.8.0 — Bundled pdf.js fallback viewer
Browsers that cannot render PDFs inside an iframe — notably Chromium
on Android — showed a placeholder instead of the document. mdrvserve
now bundles pdf.js and swaps it in for those browsers only, so every
browser gets an inline PDF. This is why the release is a minor bump:
the two vendored assets add ~1.5 MB to the binary.
Added
- Automatic pdf.js fallback. The PDF wrapper page detects browsers
without an inline PDF viewer (pdfViewerEnabledfalse, or Chromium
on Android, whose viewer reportsnavigator.pdfViewerEnabledbut
refuses iframe embeds) and renders the document through a bundled
pdf.js canvas viewer instead of the native iframe. Desktop Chrome
and Firefox keep using their built-in viewers, unchanged. The choice
can be forced either way with?pdfjs=1or?pdfjs=0on the page
URL. The sidebar stays available in both paths. - Pinch zoom. In the fallback viewer, pinch gestures zoom the
current page from 1× to 5×; the canvas is re-rendered at the new
resolution, so text stays crisp. Moving to another page resets the
zoom, and a double-tap or double-click returns to fit-width. - Horizontal slideshow mode. A toggle in the corner switches the
fallback viewer to one page per screen with horizontal swipe and
scroll snapping, plus ann / Npage indicator; the choice persists
per browser.
pdf.js 3.11.174 (Apache-2.0) is vendored into the binary and served
lazily from /pdf.min.js and /pdf.worker.min.js, fetched only when
the fallback is actually used.
v267.7.1 — PDF viewer fills the content area
The PDF wrapper's iframe collapsed to roughly 300px wide in directory
mode: the navigation layout is a flex row, #content is a flex item,
and an iframe contributes no intrinsic width — so the flex item shrank
to the iframe's 300px default instead of the usual markdown width.
#content:has(> .pdf-frame) now claims the remaining width and the
browser's PDF viewer fills the content area edge to edge, in both
Chrome and Firefox. Single-file mode was unaffected.
v267.7.0 — PDF listing with the native browser viewer
--include-pdf tracks .pdf files alongside markdown, lists them in
the sidebar, and opens them in the browser's built-in PDF viewer —
embedded in the normal preview shell, with live reload on change.
Added
--include-pdf. Directory scans now also track.pdffiles, each
with a sidebar entry. Opening one serves a wrapper page through the
standard shell (sidebar, themes, WebSocket), embedding the document
in an iframe over the raw bytes so Chrome's PDFium and Firefox's
pdf.js render it natively — no bundled viewer. Rebuilding the PDF
(typst, pandoc, latex) live-reloads the view like any other page;
the viewer restarts at page 1, which is inherent to native viewers.
Appending?raw=1to the URL serves the raw bytes instead, as
application/pdfwithContent-Disposition: inline, an mtime-based
ETag, andIf-None-Match/304 revalidation. No Range support —
browsers degrade gracefully to whole-file responses. PDF bytes are
re-read from disk per request rather than cached in memory.- Single-file PDF mode.
mdrvserve paper.pdfworks without the
flag, mirroringmdrvserve file.md.
The copy-to-clipboard source button is hidden on PDF pages, since
binary files have no text source view.
v267.6.0 — Frontmatter table and dependency refresh
Leading YAML frontmatter now renders as a GitHub-style two-column
key/value table with --with-frontmatter, so files like SKILL.md show
their name/description/license metadata instead of swallowing it.
Added
--with-frontmatter. A---block at the top of a markdown file
renders as a headerless two-column table above the document. The parse
is shallow and in document order: scalars (one layer of quotes
stripped),- itemlists joined with ", ", nested maps flattened to
dotted keys (config.theme), block scalars collected, values
HTML-escaped. Without the flag the block stays hidden, exactly as
before.- Rust dependencies refreshed (
cargo update, semver-compatible).
v267.5.0 — Installers, checksummed archives, and reading-position UX
A release-engineering release plus three small reading affordances. Linux
binaries are now static musl builds (x86_64, aarch64, and armv7 for
entware/ASUS routers), and GitHub Releases ship .tar.gz/.zip archives
with a SHA256SUMS.txt instead of bare binaries.
Added
- Real installers.
install.sh(macOS/Linux) is rewritten: it downloads
the matchingmdrvserve-v{ver}-{target}.tar.gz, verifies it against the
release'sSHA256SUMS.txt(strictly; it refuses to install without one),
and installs into~/.local/bin, with--version/--prefix/--no-path
options and upgrade detection. Newinstall.ps1does the same on Windows
(x64 and ARM64):%LOCALAPPDATA%\Programs\mdrvserveplus a user-PATH
update. Both are attached to every release, so the one-liners are
curl .../releases/latest/download/install.sh | shand
irm .../install.ps1 | iex. (The previousinstall.shwas broken: it
expected targets the release never built and guessed the wrong asset
name.) - Copy button on code blocks. Hover a fenced block to reveal it;
clicking puts the block's source on the clipboard, with anexecCommand
fallback for non-secure contexts. - Content scroll restoration. A WebSocket-triggered reload no longer
resets your reading position; it is kept per file insessionStorageand
restored once the reload paints. - Last-modified indicator. The top controls show how long ago the open
file changed ("just now", "2m ago", and so on). The server adds a
lastModifiedfield to the page data.
Changed
- Static musl Linux targets.
x86_64-unknown-linux-musl,
aarch64-unknown-linux-musl(native build on the ARM runner), and
armv7-unknown-linux-musleabihfreplace the glibc targets, so the
binaries run on any distro regardless of glibc age. - Archived release assets. Each target ships
mdrvserve-v{ver}-{target}.tar.gz(.zipon Windows, packed with bsdtar
and zip-magic-checked) containing the binary,README.md, andLICENSE,
with oneSHA256SUMS.txtcovering all assets. The build job smoke-tests
--versionon every binary before packaging.
mid: v267.4.0
tags: [release, logging, gfm, alerts, examples]
created: 2026-07-23T16:00:00+07:00
A batch release spanning observability, rendering, and learning material.
Added
- Structured logging (
--debug/-d,--trace). mdrvserve now emits
tracingevents instead of bareprintln!/eprintln!.--debug(or-d)
sets the default level to DEBUG and--traceto TRACE;RUST_LOGoverrides
either when set. Events cover startup (served path, host, port, tracked file
count, listening URL), each served request, the lazy-render cache (TRACE on
cache hit, DEBUG on render), watcher events (TRACE), new-file tracking, and
optional-binary warnings (missingtypst/d2/ typst HTML feature) plus
theopen_browserthread. - GitHub-flavored alert callouts (
--with-gfm, alias--gfm). Renders
> [!NOTE],[!TIP],[!IMPORTANT],[!WARNING], and[!CAUTION]
blockquotes into styled callout boxes with GitHub-matching hues. Implemented
as an opt-in server-side post-processor (render_gfm_alerts); plain
blockquotes pass through untouched. (markdown-rs's GFM parser covers tables,
task lists, footnotes, etc., but not alerts, so this is a separate pass.) examples/directory. Five Japanese-language competitive-programming
sample files —markdown.md(二分探索),diagrams.md(graph algorithms,
exercising D2/LaTeX/Mermaid/Typst),page.html(a complexity cheat sheet),
document.typ(a multi-page Segment-Tree lesson), and aREADME.mdrun
guide — for trying every rendering engine end to end, including CJK text.
Why
Logging makes the lazy-render pipeline from v267.3.0 observable: cache hits,
watch events, and startup are visible without recompiling. GFM alerts are the
most common markdown callout syntax and were the natural next rendering
affordance. The examples double as a manual test harness for every engine.
mid: v267.3.0
tags: [release, performance, rendering, startup]
created: 2026-07-23T14:00:00+07:00
Directory-mode startup no longer renders every tracked file up front. Rendering
is deferred to first request, cutting boot time from roughly a minute (500+
markdown files) to a fraction of a second, while keeping serving entirely
from memory.
Changed
- Render on first request, not at boot.
TrackedFile.htmlis now
Option<String>. Startup walks the directory and reads each file's source
text — it does no rendering. The firstGETof a file renders it (and, for
.typ, both paged and free-flow forms) and caches the result; every later
request is a pureHashMaplookup. - Invalidate on change. The file watcher no longer re-renders eagerly. It
re-reads the source and clears the cached HTML; the browser's WebSocket-
triggered reload performs the re-render. Because the reload path already calls
window.location.reload(), no frontend change was needed. - Single-user locking. The new
ensure_rendered()renders under the existing
tokio state mutex. Render functions are synchronous and the server is
single-user, so there is no deadlock risk and no double-render race.
Why
A directory of 500+ markdown files took almost a minute to start because every
file was rendered eagerly. Lazy rendering preserves the zero-config default
(mdrvserve dir/ just works) while making boot essentially free — only files
actually opened pay the render cost, and only once.
Invariant change
The design constraint "Pre-rendered in memory. All tracked files are rendered
to HTML on startup and on change." becomes "Rendered on demand, served from
memory — rendered on first request and cached; invalidated on change. Serving
is always from memory." AGENTS.md, the overview, architecture, and rendering
docs were updated to match.
v267.4.0 — Structured logging, GFM alerts, and example docs
A batch release spanning observability, rendering, and learning material.
Added
- Structured logging (
--debug/-d,--trace). mdrvserve now emits
tracingevents instead of bareprintln!/eprintln!.--debug(or-d)
sets the default level to DEBUG and--traceto TRACE;RUST_LOGoverrides
either when set. Events cover startup (served path, host, port, tracked file
count, listening URL), each served request, the lazy-render cache (TRACE on
cache hit, DEBUG on render), watcher events (TRACE), new-file tracking, and
optional-binary warnings (missingtypst/d2/ typst HTML feature) plus
theopen_browserthread. - GitHub-flavored alert callouts (
--with-gfm, alias--gfm). Renders
> [!NOTE],[!TIP],[!IMPORTANT],[!WARNING], and[!CAUTION]
blockquotes into styled callout boxes with GitHub-matching hues. Implemented
as an opt-in server-side post-processor (render_gfm_alerts); plain
blockquotes pass through untouched. (markdown-rs's GFM parser covers tables,
task lists, footnotes, etc., but not alerts, so this is a separate pass.) examples/directory. Five Japanese-language competitive-programming
sample files —markdown.md(二分探索),diagrams.md(graph algorithms,
exercising D2/LaTeX/Mermaid/Typst),page.html(a complexity cheat sheet),
document.typ(a multi-page Segment-Tree lesson), and aREADME.mdrun
guide — for trying every rendering engine end to end, including CJK text.
Why
Logging makes the lazy-render pipeline from v267.3.0 observable: cache hits,
watch events, and startup are visible without recompiling. GFM alerts are the
most common markdown callout syntax and were the natural next rendering
affordance. The examples double as a manual test harness for every engine.
mid: v267.3.0
tags: [release, performance, rendering, startup]
created: 2026-07-23T14:00:00+07:00
Directory-mode startup no longer renders every tracked file up front. Rendering
is deferred to first request, cutting boot time from roughly a minute (500+
markdown files) to a fraction of a second, while keeping serving entirely
from memory.
Changed
- Render on first request, not at boot.
TrackedFile.htmlis now
Option<String>. Startup walks the directory and reads each file's source
text — it does no rendering. The firstGETof a file renders it (and, for
.typ, both paged and free-flow forms) and caches the result; every later
request is a pureHashMaplookup. - Invalidate on change. The file watcher no longer re-renders eagerly. It
re-reads the source and clears the cached HTML; the browser's WebSocket-
triggered reload performs the re-render. Because the reload path already calls
window.location.reload(), no frontend change was needed. - Single-user locking. The new
ensure_rendered()renders under the existing
tokio state mutex. Render functions are synchronous and the server is
single-user, so there is no deadlock risk and no double-render race.
Why
A directory of 500+ markdown files took almost a minute to start because every
file was rendered eagerly. Lazy rendering preserves the zero-config default
(mdrvserve dir/ just works) while making boot essentially free — only files
actually opened pay the render cost, and only once.
Invariant change
The design constraint "Pre-rendered in memory. All tracked files are rendered
to HTML on startup and on change." becomes "Rendered on demand, served from
memory — rendered on first request and cached; invalidated on change. Serving
is always from memory." AGENTS.md, the overview, architecture, and rendering
docs were updated to match.
v267.3.0 — Lazy rendering for faster startup
Directory-mode startup no longer renders every tracked file up front. Rendering
is deferred to first request, cutting boot time from roughly a minute (500+
markdown files) to a fraction of a second, while keeping serving entirely
from memory.
Changed
- Render on first request, not at boot.
TrackedFile.htmlis now
Option<String>. Startup walks the directory and reads each file's source
text — it does no rendering. The firstGETof a file renders it (and, for
.typ, both paged and free-flow forms) and caches the result; every later
request is a pureHashMaplookup. - Invalidate on change. The file watcher no longer re-renders eagerly. It
re-reads the source and clears the cached HTML; the browser's WebSocket-
triggered reload performs the re-render. Because the reload path already calls
window.location.reload(), no frontend change was needed. - Single-user locking. The new
ensure_rendered()renders under the existing
tokio state mutex. Render functions are synchronous and the server is
single-user, so there is no deadlock risk and no double-render race.
Why
A directory of 500+ markdown files took almost a minute to start because every
file was rendered eagerly. Lazy rendering preserves the zero-config default
(mdrvserve dir/ just works) while making boot essentially free — only files
actually opened pay the render cost, and only once.
Invariant change
The design constraint "Pre-rendered in memory. All tracked files are rendered
to HTML on startup and on change." becomes "Rendered on demand, served from
memory — rendered on first request and cached; invalidated on change. Serving
is always from memory." AGENTS.md, the overview, architecture, and rendering
docs were updated to match.
v267.2.1 — Typst free-flow uses HTML export
The free-flow layout introduced in v267.2.0 re-compiled each .typ document
with #set page(height: auto, fill: none) and tried to recolour the resulting
paged SVG — an approach that did not yield usable output. It is replaced with
Typst's native HTML export.
Changed
- Free-flow now uses HTML export.
.typdocuments are re-compiled with
typst compile - - --format html --features html, producing reflowable
semantic HTML (<h2>,<p>,<ul>,<figure>, …) with native MathML
for equations. The emitted<style>is MathML-alignment CSS only — no
colours, no fonts — so the output inherits the active theme: dark mode works
and math glyphs follow the text colour. - Toggle disabled when unavailable. A new
typst_html_available()probe
(OnceLock-cached) checks whether the installedtypstbinary supports
--features html. When it does not, the free-flow button renders disabled
with the tooltip "typstdoesn't have HTML feature enabled"; there is no SVG
fallback. Paged SVG rendering is unaffected. - Startup warning. When Typst is requested but the installed binary lacks
the HTML feature,serve_markdownlogs a warning noting that free-flow is
disabled and how to enable it (install a Typst built with--features html,
0.13+). - Frontend.
App.sveltederivesfreeflowAvailablefrom a non-empty
contentFreeflow;TopControls.sveltedisables the button and swaps its
tooltip when unavailable;.typst-doc-freeflowCSS is simplified to inherit
theme colours and constrain inline media.
v267.2.0 — Typst rendering with free-flow toggle
Adds Typst as a first-class rendering target alongside D2, Mermaid, and LaTeX.
Typst documents and fenced blocks are compiled server-side to SVG by shelling
out to the typst binary — matching the existing D2 model (no heavy in-process
crate, no client-side WASM). Pages are left white even in dark themes, since
Typst's paged model assumes paper. The typst binary is optional: if it is not
on PATH, a startup warning is printed and every Typst block or .typ file
degrades gracefully to an escaped source listing.
Added
- Typst fenced-block engine (
--with-typst).```typstblocks inside
.md/.htmlare rendered to SVG server-side viatypst compile - - --format svg(stdin → stdout) and inlined astypst-doc-pagecontainers. This
mirrors--with-d2exactly: one compile per block, unique SVGs inlined into
the stored HTML, no client JS, no render delay. - Standalone
.typfile tracking (--include-typst). Directory mode can now
track.typfiles alongside markdown and HTML. Each file is compiled through a
temp directory using apage-{0p}-of-{t}.svgtemplate, so multi-page
documents render as a stack of.typst-doc-pageSVGs separated by
.typst-page-breakrules. Independent of--with-typst:.typrendering is
gated by file extension, not by the block-engine flag. - Free-flow layout toggle. On Typst-format source pages, a layout button
(📄 paged / 📜 free-flow) appears as the leftmost control, to the left of the
zoom slider. Paged is the default (stacked white pages). Free-flow re-compiles
the document with#set page(height: auto, fill: none), recolours every glyph
from the baked#000000tocurrentColor, and renders a single transparent
sheet that adopts the theme text colour and reflows to the content column.
Both renderings are pre-computed server-side; the toggle switches between the
two in-memory blobs with no extra compile. The choice persists across
navigations vialocalStorage.
Changed
- Optional-binary pattern extended.
typst_available()mirrors
d2_available()(OnceLock-cachedtypst --versioncheck), and
serve_markdownprints the same startup warning shape when Typst is requested
but missing. tempfilepromoted from a dev-dependency to a runtime dependency, since
render_typst_document/render_typst_document_freeflowspin up a temp
directory for multi-page compilation.