mbr Markdown Browser Documentation

logo

mbr - Markdown Browser Documentation

mbr is a fast tool for browsing, previewing, and publishing markdown. Point it at any collection of markdown files - no custom syntax or directory structures required.

This documentation site is built with mbr. It serves as a live example of mbr’s features including navigation like browsing and searching, and extended syntax like mermaid diagrams and embedded media. Browse around to see mbr in action. Hit minus (-) or click the hamburger icon in the top left to browse or hit slash (/) to search.

SectionDescription
Getting StartedInstallation and first steps
Modes of OperationGUI, Server, Build, and QuickLook
CustomizationThemes, templates, and components
Markdown ExtensionsExtended syntax reference
CLI ReferenceCommand line options
ArchitectureTechnical overview
DevelopmentBuilding and contributing

What is mbr?

mbr is three tools in one:

  1. Markdown Previewer - Render any markdown file instantly with live reload
  2. Markdown Browser - Navigate folders, tags, and search across thousands of files
  3. Static Site Generator - Build deployable websites with full-text search

Key Principles

Giphy animation

How It Works

Previewing: the mbr binary has built-in html template, css, and javascript defaults that are combined with html that derives from the current markdown file. For any given repository of markdown files, there’s a check for a .mbr/ folder. The html templates, css, and javascript are fetched from there if they exist and fall back to the built-in defaults if they don’t.

Exploring: in live mode (server or GUI), an initial file is rendered and in the background, an index of markdown files, assets, and metadata for each file (including frontmatter) is compiled and loaded into the GUI browser window. That info is stored as a JSON file in a static build. Also in static builds, full content search indices are generated, while in server and GUI mode content searches grep through files.

flowchart LR
    subgraph Input
        MD[Markdown Files]
    end

    subgraph mbr
        PARSE[Parse & Render]
        TMPL[Templates]
        SEARCH[Search Index]
        BINDEX[Browse Index]
    end

    subgraph Output
        HTML[HTML Pages]
        NAV[Navigation]
        IDX[Static Mode: Pagefind Search, Live Mode: Grep]
    end

    MD --> PARSE
    PARSE --> TMPL --> HTML
    PARSE --> BINDEX --> NAV
    PARSE --> SEARCH --> IDX

Quick Example

# Preview a single file
mbr README.md

# Browse your notes with a web server
mbr -s ~/notes

# Launch a native GUI window
mbr -g ~/notes

# Build a static site
mbr -b ~/notes

Customization at a Glance

Optionally create a .mbr/ folder in your markdown repository to customize how a given repository is handled and presented:

your-notes/
├── .mbr/
│   ├── config.toml    # Configuration
│   ├── theme.css      # Replace the default theme
│   └── user.css       # Add or override select styles
├── whatever.md
└── subdir/
    └── important-note.md

See Customization for the full guide.