Ubunatic Coding

Local Markdown · Offline Mermaid · mdBook

mdview read connected Markdown documents locally.

Render a Markdown file in your terminal or as standalone HTML, or build a navigable mdBook from related project documents. Generated navigation and embedded Mermaid keep the book useful offline.

go install ubunatic.com/mdview@latest

Read project docs without assembling a book by hand

Project documentation is spread across related Markdown files. mdview discovers them from one input file, organizes their frontmatter into a table of contents, and delegates multi-page HTML rendering to mdBook. Single-file terminal and HTML previews keep small reading tasks simple.

From Markdown to a local documentation book

What mdview Offers Now

The current project scope is intentionally narrow: manage local Markdown docs as an mdBook, with generated navigation and offline Mermaid rendering.

Doc Discovery

Starts from one Markdown file, finds a project root, and gathers related docs while skipping cache and dependency directories.

Generated mdBook

Creates book.toml, SUMMARY.md, and a mirrored source tree under .cache/mdview, then runs mdbook build.

Offline Mermaid

Embeds local Mermaid JavaScript assets into the generated book so diagrams work without CDN access.

Frontmatter Hierarchy

Uses title, parent, and weight frontmatter to shape the mdBook summary and automate ToC creation.

Local & HTML Preview

mdview SomeDoc.md renders Markdown and inline images directly in your terminal; --html produces a standalone single-file preview, and mdview book open builds the full mdBook.

Small Go CLI

The implementation stays compact, avoids Electron and TypeScript, and uses external tools only where they already fit the job.

How It Works

mdview renders single files to the terminal or standalone HTML, or prepares a project workspace and lets mdBook do the final multi-page HTML rendering.

  1. Input a Markdown file such as SomeDoc.md.
  2. Discover the project root and related documents.
  3. Summarize frontmatter into SUMMARY.md.
  4. Build with mdbook build .cache/mdview.
  5. Open the generated local HTML.
mdview docs/Project.md
mdview docs/Project.md --html
mdview book open docs/Project.md

Terminal output includes ANSI text and cati images. --html produces a standalone single-file preview; book open builds the whole-project mdBook under .cache/mdview/book. Serving a local book uses 127.0.0.1.

A sample whole-project book run reports its discovered pages and local output:

root /home/uwe/projects/mdview
pages 5
built .cache/mdview/book
opened .cache/mdview/book/docs/Project.html

Where This Is Going

These directions are planned work, not claims about current features.

The long-term direction is broader than mdBook: mdview should become a Markdown docs browser that feels like cat plus tree, but interactive and built for connected documentation.

Like cat and tree, but for Markdown projects.

At a glance

Stack
Go 1.25, Cobra, cati, mdBook, embedded Mermaid JavaScript
Commits
2