Skip to content

About

A calm, on-device reader for folders of Markdown. No install, no uploads, no network requests.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

36 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Better MD viewer

A calm reader for folders of Markdown that runs entirely in your browser. Open a folder and read: nothing is uploaded, nothing is installed, and the page makes no network requests of its own.

Open the viewer →

Better MD viewer showing a handbook folder in the Slate theme

Features

  • Whole folders, not single files. A compact tree with collapsible folders, a filter by name, and search inside files with match counts. Click a #tag to find every file that uses it.
  • Links that work. Relative links, images, #heading anchors and [[wiki links]] resolve inside the folder, and the URL follows the file and heading you're on.
  • GitHub-flavoured Markdown. Tables, task lists, alerts (> [!NOTE]), footnotes, frontmatter and syntax highlighting, with a Copy button on code blocks.
  • Live reload. The open file re-renders when it changes on disk and highlights what changed. New or deleted files show up on their own, and the tree marks files that changed since you last opened them.
  • Picks up where you left off. Recent folders and the last file you read are remembered in the browser, and going back to a file returns you to where you were in it.
  • Private by design. Fonts and libraries ship with the page, a Content-Security-Policy keeps it local, and remote images stay blocked until you allow them.
  • Comfortable to read. An outline of headings, twelve themes or one that follows your system's light and dark mode, adjustable type and width, a layout for phones, and clean printing.

Use it

  1. Open the hosted viewer, or clone this repo and open index.html. There is no build step and no server to run.
  2. Click Open folder, or drag a folder onto the page.

Chrome, Edge and Arc read the folder directly, which is what makes live reload and reopening recent folders work. Safari and Firefox fall back to a file picker that reads a one-time copy; the browser calls it an upload, but the files never leave your machine.

Keyboard

Key Action
⌘O / Ctrl O Open a folder
j / k Next / previous file
/ Search (Esc clears it)
⌘B / Ctrl B Show or hide the sidebar

Screenshots

The Paper theme showing a decision record, next to the phone layout in Slate

After a live reload, the edited paragraph and table row are highlighted, and the tree marks a note that changed in the background:

A live reload in the Slate theme, with the changed paragraph and table row highlighted and a changed note marked in the tree

How it works

Plain HTML, CSS and JavaScript, with no build step and nothing to install. marked turns Markdown into HTML, DOMPurify sanitizes it, and highlight.js colours code. Folders are read through the File System Access API where the browser has it.

File What's in it
index.html Page structure and the Content-Security-Policy
assets/app.js Reading folders, rendering, links, live reload, search
assets/style.css The design system; each theme sets a small palette
test/run.cjs Browser tests

Tests

test/run.cjs opens the viewer in Chromium through Playwright, with a fake folder in place of the folder picker, and runs about 120 checks. Playwright isn't part of the repo, so install it once, anywhere else:

npm install --prefix ~/.cache/bmv-tests playwright@1.58.2
~/.cache/bmv-tests/node_modules/.bin/playwright install chromium

Then, from the repo:

node test/run.cjs ~/.cache/bmv-tests/node_modules/playwright

To check the live site instead, add its address as a second argument.

Third-party code

License

MIT. See LICENSE.

About

A calm, on-device reader for folders of Markdown. No install, no uploads, no network requests.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors

Languages