Server port. Defaults to 8080 unless MDVIEW_PORT is set.
-c, --convert
Convert a Markdown file to standalone HTML instead of starting the server.
-o, --output
Output file path for conversion mode.
-v, --version
Print the embedded version string.
Behavior
Passing a Markdown file starts file mode and watches that file for reloads.
Passing a directory starts directory mode and serves a file browser rooted at that path.
Markdown files are rendered as HTML pages, while other files are served directly.
If the requested port is already in use, mdview probes the next ports until it finds a free one or gives up after 1000 attempts.
Conversion mode writes a self-contained HTML file with embedded styling.
Development
go test ./...
go run . .
Third-party notices
internal/assets/github-markdown.css is derived from github-markdown-css v5.5.1, and internal/assets/mermaid.min.js is bundled from mermaid v11.12.0. Both are MIT licensed. See THIRD_PARTY_NOTICES.txt for the bundled attribution summary.