markhub

module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 14, 2026 License: MIT

README ΒΆ

MarkHub

CI codecov License Go Version

In the AI era, documentation lives across multiple repositories and branches β€” design docs on feature-x, API specs on main, architecture notes on v2-refactor. MarkHub brings them all into a single, beautiful web interface.

Point it at any number of local repos and git refs to instantly browse Markdown files with live hot-reload, syntax highlighting, and a premium reading experience. Zero configuration, single binary, just run and read.

Features

  • πŸ“ Multi-Folder Support - Serve multiple directories simultaneously with custom aliases
  • 🌿 Git Ref Browsing - Browse any branch, tag, or commit without checking it out
  • ✨ GFM Support - Full GitHub Flavored Markdown with tables, task lists, and more
  • 🎨 Syntax Highlighting - Beautiful code blocks with automatic language detection
  • πŸ”₯ Hot Reload - Live updates via WebSocket when files change
  • πŸŒ“ Dark / Light Theme - Optimized light and dark themes
  • 🧘 Zen Mode - Distraction-free reading (Ctrl+Shift+Z)
  • πŸš€ Single Binary - No external runtime required, all assets embedded

Installation

One-line install (Linux / macOS):

curl -sSfL https://raw.githubusercontent.com/CageChen/markhub/master/install.sh | sh

Go install (requires Go 1.24+):

go install github.com/CageChen/markhub/cmd/markhub@latest

Build from source:

git clone https://github.com/CageChen/markhub.git
cd markhub
make build

Docker:

docker build -t markhub .
docker run -p 8080:8080 -v $(pwd)/docs:/docs markhub

Quick Start

markhub --path ./docs --open

Configuration

MarkHub loads config from ~/.config/markhub/config.yaml or ./markhub.yaml (use --config to override):

folders:
  - path: ./docs
    alias: Documentation
  - path: ./projects/web/notes
    alias: Web Notes
    exclude: ["drafts/**", "temp/**"]       # folder-level excludes
  - path: /home/user/my-repo
    alias: "my-repo (main)"
    git_ref: main                           # browse a git branch
    sub_path: docs                          # only serve a subdirectory
port: 8080
theme: dark
watch: true
extensions:
  - .md
  - .markdown

# global excludes β€” dependency dirs contain thousands of .md files from packages
exclude:
  - node_modules
  - .git
  - .svn
  - vendor

# repo-level excludes (applied to all refs of the same repo)
repo_exclude:
  /home/user/my-repo:
    - "internal/**"

Run ./bin/markhub --help for all CLI options.

License

MIT License - see LICENSE for details.

Directories ΒΆ

Path Synopsis
cmd
markhub command
Package main is the entry point for the MarkHub server.
Package main is the entry point for the MarkHub server.
internal
config
Package config manages YAML-based configuration, CLI flags, and multi-folder settings.
Package config manages YAML-based configuration, CLI flags, and multi-folder settings.
fs
Package fs provides filesystem abstractions for reading files from local disk or git repos.
Package fs provides filesystem abstractions for reading files from local disk or git repos.
handler
Package handler provides HTTP handlers for the MarkHub REST API.
Package handler provides HTTP handlers for the MarkHub REST API.
markdown
Package markdown provides Goldmark-based Markdown parsing with GFM extensions and syntax highlighting.
Package markdown provides Goldmark-based Markdown parsing with GFM extensions and syntax highlighting.
watcher
Package watcher monitors file system changes and broadcasts events via callbacks.
Package watcher monitors file system changes and broadcasts events via callbacks.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL