A simple, single-binary web server that acts as a file browser and Markdown renderer.
- 2-Pane View: A persistent, expandable file tree on the left and a content viewer on the right.
- Single Binary: All UI assets (CSS, JavaScript, HTML templates) are embedded directly into the executable; no installation or external dependencies required.
- Local First: Serves files and directories from the current location where you run it, with a self-contained UI.
- Markdown Rendering: Renders Markdown files with GitHub-like styling, built-in syntax highlighting, and bundled Mermaid diagram support.
- Secure by Default: Includes protection against directory traversal attacks and sanitizes HTML to prevent Cross-Site Scripting (XSS).
- Graceful Shutdown: Shuts down safely via a UI button or
Ctrl+C.
- Download the latest
mdvbinary for your operating system from the Releases page. - Run the executable from your terminal:
./mdv
- Open your web browser and navigate to
http://127.0.0.1:8888(or the port you specify).
mdv can be configured using a config.json file or command-line flags. The configuration is loaded in the following order of precedence (later ones override earlier ones):
- Default values
config.jsonin$HOME/.config/mdv/config.jsonin the current working directory- Environment variables (prefixed with
MDV_, e.g.,MDV_PORT=9000) - Command-line flags
For an example configuration file, see config.json.example.
-p, --port int: Specifies the port to listen on (default 8888).-o, --open: Automatically opens the default web browser to the application URL upon startup.-d, --dir string: Specifies the root directory to serve (default ".").-h, --help: Displays the help message.--version: Displays the application version.
To build the project from source, you need to have Go and Make installed.
- Clone the repository:
git clone https://github.com/magifd2/markdown-viewer.git cd markdown-viewer - Build the
mdvbinary:Themake build
mdvbinary will be generated in thebin/<OS>-<ARCH>/directory (e.g.,bin/darwin-arm64/mdv). - Run the application:
This will build and then run the
make run
mdvapplication.
For cross-platform builds, see the Makefile for more options (make help).
This project is licensed under the MIT License. See the LICENSE file for details.
This project bundles third-party software components. Their licenses and attribution notices are available in the NOTICE.md file included in the distribution.