Skip to content

Releases

v267.9.0 — SVG listing with --include-svg

Choose a tag to compare

@github-actions github-actions released this 15 Nov 07:48

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 (![logo](logo.svg)) keeps working unchanged.

Added

  • --include-svg flag. Tracks .svg files in directory mode; a single
    .svg path 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=1 serves the raw bytes with
    Content-Disposition: inline and an mtime-based ETag (If-None-Match →
    304).
  • Markdown embedding keeps working. An <img> inside markdown
    advertises image/svg+xml in its Accept header; a top-level navigation
    does not. Tracked files still serve raw bytes to image requests instead
    of the wrapper page, so ![logo](logo.svg) renders 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

Choose a tag to compare

@github-actions github-actions released this 31 Oct 16:55

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 (pdfViewerEnabled false, or Chromium
    on Android, whose viewer reports navigator.pdfViewerEnabled but
    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=1 or ?pdfjs=0 on 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 an n / N page 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

Choose a tag to compare

@github-actions github-actions released this 29 Oct 11:30

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

Choose a tag to compare

@github-actions github-actions released this 29 Oct 09:09

--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 .pdf files, 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=1 to the URL serves the raw bytes instead, as
    application/pdf with Content-Disposition: inline, an mtime-based
    ETag, and If-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.pdf works without the
    flag, mirroring mdrvserve 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

Choose a tag to compare

@github-actions github-actions released this 04 Oct 07:16

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), - item lists 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

Choose a tag to compare

@github-actions github-actions released this 29 Sep 23:27

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 matching mdrvserve-v{ver}-{target}.tar.gz, verifies it against the
    release's SHA256SUMS.txt (strictly; it refuses to install without one),
    and installs into ~/.local/bin, with --version/--prefix/--no-path
    options and upgrade detection. New install.ps1 does the same on Windows
    (x64 and ARM64): %LOCALAPPDATA%\Programs\mdrvserve plus a user-PATH
    update. Both are attached to every release, so the one-liners are
    curl .../releases/latest/download/install.sh | sh and
    irm .../install.ps1 | iex. (The previous install.sh was 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 an execCommand
    fallback for non-secure contexts.
  • Content scroll restoration. A WebSocket-triggered reload no longer
    resets your reading position; it is kept per file in sessionStorage and
    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
    lastModified field 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-musleabihf replace 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 (.zip on Windows, packed with bsdtar
    and zip-magic-checked) containing the binary, README.md, and LICENSE,
    with one SHA256SUMS.txt covering all assets. The build job smoke-tests
    --version on 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
    tracing events instead of bare println!/eprintln!. --debug (or -d)
    sets the default level to DEBUG and --trace to TRACE; RUST_LOG overrides
    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 (missing typst / d2 / typst HTML feature) plus
    the open_browser thread.
  • 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 a README.md run
    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.html is now
    Option<String>. Startup walks the directory and reads each file's source
    text — it does no rendering. The first GET of a file renders it (and, for
    .typ, both paged and free-flow forms) and caches the result; every later
    request is a pure HashMap lookup.
  • 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

Choose a tag to compare

@github-actions github-actions released this 23 Jul 15:40

A batch release spanning observability, rendering, and learning material.

Added

  • Structured logging (--debug/-d, --trace). mdrvserve now emits
    tracing events instead of bare println!/eprintln!. --debug (or -d)
    sets the default level to DEBUG and --trace to TRACE; RUST_LOG overrides
    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 (missing typst / d2 / typst HTML feature) plus
    the open_browser thread.
  • 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 a README.md run
    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.html is now
    Option<String>. Startup walks the directory and reads each file's source
    text — it does no rendering. The first GET of a file renders it (and, for
    .typ, both paged and free-flow forms) and caches the result; every later
    request is a pure HashMap lookup.
  • 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

Choose a tag to compare

@github-actions github-actions released this 23 Jul 15:41

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.html is now
    Option<String>. Startup walks the directory and reads each file's source
    text — it does no rendering. The first GET of a file renders it (and, for
    .typ, both paged and free-flow forms) and caches the result; every later
    request is a pure HashMap lookup.
  • 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

Choose a tag to compare

@github-actions github-actions released this 23 Jul 15:39

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. .typ documents 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 installed typst binary supports
    --features html. When it does not, the free-flow button renders disabled
    with the tooltip "typst doesn'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_markdown logs a warning noting that free-flow is
    disabled and how to enable it (install a Typst built with --features html,
    0.13+).
  • Frontend. App.svelte derives freeflowAvailable from a non-empty
    contentFreeflow; TopControls.svelte disables the button and swaps its
    tooltip when unavailable; .typst-doc-freeflow CSS is simplified to inherit
    theme colours and constrain inline media.

v267.2.0 — Typst rendering with free-flow toggle

Choose a tag to compare

@github-actions github-actions released this 23 Jul 06:08

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). ```typst blocks inside
    .md/.html are rendered to SVG server-side via typst compile - - --format svg (stdin → stdout) and inlined as typst-doc-page containers. This
    mirrors --with-d2 exactly: one compile per block, unique SVGs inlined into
    the stored HTML, no client JS, no render delay.
  • Standalone .typ file tracking (--include-typst). Directory mode can now
    track .typ files alongside markdown and HTML. Each file is compiled through a
    temp directory using a page-{0p}-of-{t}.svg template, so multi-page
    documents render as a stack of .typst-doc-page SVGs separated by
    .typst-page-break rules. Independent of --with-typst: .typ rendering 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 #000000 to currentColor, 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 via localStorage.

Changed

  • Optional-binary pattern extended. typst_available() mirrors
    d2_available() (OnceLock-cached typst --version check), and
    serve_markdown prints the same startup warning shape when Typst is requested
    but missing.
  • tempfile promoted from a dev-dependency to a runtime dependency, since
    render_typst_document / render_typst_document_freeflow spin up a temp
    directory for multi-page compilation.