Preview local Markdown files and doc trees with live reload, sidebar navigation, anchors, and syntax highlighting
Project description
markserv
markserv opens local Markdown files and docs folders in your browser as a lightweight live-preview web app.
Point it at a README, notes directory, or docs tree and you get a clean GitHub-style reading view with live reload, sidebar navigation, heading anchors, syntax highlighting, and theme switching.
Why markserv?
- GitHub-flavored Markdown rendering via
cmarkgfm - Live reload while editing local docs
- Sidebar navigation for directory-based docs
- Automatic heading anchors for deep-linking
- Syntax highlighting for fenced code blocks
- YAML front matter for titles and nav metadata
- Safer asset serving defaults for linked local files
- System, light, and dark theme support with saved preference
Install
Requires Python 3.11+
| Use case | Command |
|---|---|
Install from PyPI with uv |
uv tool install markserv |
Install from PyPI with pipx |
pipx install markserv |
| Install a local checkout for development | uv tool install . |
Quick start
Serve a docs directory
markserv docs/
Serve a single Markdown file
markserv README.md
Run the built-in demo site
markserv.demo
Common variations
| Command | What it does |
|---|---|
markserv . |
Serve the current directory |
markserv --host localhost --port 4422 . |
Bind to a custom host/port |
markserv --no-open README.md |
Start without opening a browser |
markserv.demo --no-open --port 9001 |
Run the demo on a custom port |
What it does
- Renders common Markdown extensions like
.mdand.markdown - Watches Markdown files and reloads the browser when content changes
- Respects
.gitignorewhile scanning, so ignored trees like.venv/are skipped - Serves linked local assets from the same file tree with safer defaults for hidden, executable, and sensitive files
- In directory mode, shows a sidebar for browsing multiple Markdown pages
- Adds heading anchors automatically for easy deep-linking
- Syntax-highlights fenced code blocks
- Supports YAML front matter for page titles and navigation labels/order
- Remembers your theme choice in browser storage
Front matter
markserv supports YAML front matter for page and navigation metadata:
---
title: Overview
nav_label: Start Here
nav_order: 10
hidden: false
---
# Overview
| Key | Purpose |
|---|---|
title |
Browser/page title fallback |
nav_label |
Sidebar label override |
nav_order |
Numeric sort order in the sidebar |
hidden |
Hide the page from sidebar navigation while keeping it routable |
Tech stack
markserv uses:
cmarkgfmfor GitHub-flavored Markdown renderingFastAPIfor the local web appFastHXfor HTMX-aware FastAPI renderinghtmyfor Python component-based HTML renderinggithub-markdown-cssfor GitHub-like stylingwatchfilesfor live reloadignoretreeto respect.gitignorerules while scanning
Development
Install dev tooling:
make install
Common commands:
| Task | Command |
|---|---|
| Format | make format |
| Check formatting | make format-check |
| Lint | make lint |
| Type-check | make typecheck |
| Test | make test |
| Run the full local CI suite | make all-ci |
Notes
markservis intended for plain Markdown / GFM-style docs, not MDX.- UI components are rendered with
htmyfrom Python. - Front-end assets live under
src/markserv/public/. - Bundled CSS comes from
github-markdown-cssand generated Pygments themes. - Bundled HTMX assets are used for SSE-driven live updates.
- The upstream stylesheet license is included at
src/markserv/public/licenses/github-markdown-css.LICENSE. - The bundled HTMX license is included at
src/markserv/public/licenses/htmx.LICENSE.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file markserv-1.1.0.tar.gz.
File metadata
- Download URL: markserv-1.1.0.tar.gz
- Upload date:
- Size: 55.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9e05b0b5dc63194cfb0cdf182d7154759465805a4f9f26109224f83876717dc
|
|
| MD5 |
2bad44237b3f1bcb1b0c9a3c1ba4584d
|
|
| BLAKE2b-256 |
c21cb9284ac0afe55309f52c271c6b223f5c814114a7de628ef08e95db471b11
|
Provenance
The following attestation bundles were made for markserv-1.1.0.tar.gz:
Publisher:
release.yml on nathan-gage/markserv
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
markserv-1.1.0.tar.gz -
Subject digest:
b9e05b0b5dc63194cfb0cdf182d7154759465805a4f9f26109224f83876717dc - Sigstore transparency entry: 1270433291
- Sigstore integration time:
-
Permalink:
nathan-gage/markserv@0e5f536c2be0023d1a0953d2160828328b7f35c9 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/nathan-gage
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0e5f536c2be0023d1a0953d2160828328b7f35c9 -
Trigger Event:
push
-
Statement type:
File details
Details for the file markserv-1.1.0-py3-none-any.whl.
File metadata
- Download URL: markserv-1.1.0-py3-none-any.whl
- Upload date:
- Size: 66.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6fc721e8507edf81ca24e46672986b906e7e9d4452e7e1bd46ed7d69b9bc902d
|
|
| MD5 |
a7cc06956fcd03a569b3f155a2a24c37
|
|
| BLAKE2b-256 |
ad18e88369cd0acbbb67c39956268b2d349714e111f073cc218e7d6eca684267
|
Provenance
The following attestation bundles were made for markserv-1.1.0-py3-none-any.whl:
Publisher:
release.yml on nathan-gage/markserv
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
markserv-1.1.0-py3-none-any.whl -
Subject digest:
6fc721e8507edf81ca24e46672986b906e7e9d4452e7e1bd46ed7d69b9bc902d - Sigstore transparency entry: 1270433314
- Sigstore integration time:
-
Permalink:
nathan-gage/markserv@0e5f536c2be0023d1a0953d2160828328b7f35c9 -
Branch / Tag:
refs/tags/v1.1.0 - Owner: https://github.com/nathan-gage
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0e5f536c2be0023d1a0953d2160828328b7f35c9 -
Trigger Event:
push
-
Statement type: