Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xrfang/mdv
Markdown Viewer
https://github.com/xrfang/mdv
Last synced: 3 months ago
JSON representation
Markdown Viewer
- Host: GitHub
- URL: https://github.com/xrfang/mdv
- Owner: xrfang
- License: mit
- Created: 2021-01-18T03:34:04.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-11-07T09:00:01.000Z (about 1 year ago)
- Last Synced: 2024-05-19T02:11:08.597Z (6 months ago)
- Language: JavaScript
- Homepage:
- Size: 682 KB
- Stars: 16
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-docs - mdv
- jimsghstars - xrfang/mdv - Markdown Viewer (JavaScript)
README
# mdv - Markdown Viewer
**MDV** is a "pure" markdown viewer in the sense that 1) it is just a viewer (not an editor); 2) it is a standalone tool, not a browser plugin. Comparing to other viewers (or editors), **MDV** provides a pleasant viewing experience and at the same time is customizable and versatile.
## USAGE
### Installation
1. Assuming you are using Linux or Mac, clone this repo and run `make` in the working directory. Windows users may download binary releases from [GitHub](https://github.com/xrfang/mdv/releases/) directly.
2. Cross-compiling is done by running `make windows`, `make linux` or `make mac` respectively.
3. Copy `mdv` (or `mdv.exe`) to a directory listed in system `PATH`, and associate it with `.md` file.### Command Line
```none
Markdown ViewerUSAGE: mdv [OPTIONS]
OPTIONS:
-port int
HTTP port (auto if not specified)
-serve
serve only (do not open in browser)
-version
show version info
```### Customize
**MDV** will generate its configuration under `/mdv` folder. `USER-CONFIG` is `~/.config` on Linux, `%APPDATA%` on Windows and `~/Library/Application Support` on Mac. The `config.json` file in that folder contains the following options:
```json
{
"main_css": "default.css",
"code_css": "highlight.css",
"port": 0,
"recurse": 2,
"rev": 39
}
```Options are:
* **main_css**: name of the primary stylesheet
* **code_css**: stylesheet for [syntax highlighting](https://highlightjs.org/)
* **port**: HTTP port, 0 means auto select
* **recurse**: level of sub-directories to search for markdown files (1~9, default 2)
* **rev**: revision of **MDV** that generated this config fileUsually, there is no need to edit this config file, except that you may want to use a new stylesheet. Alternatively, you can also edit the `default.css` file directly to tweak display effects. Also, there is a `highlight.css` which is the stylesheet for [syntax highlighting](https://highlightjs.org/).
> **Hint**: when the version of **MDV** upgrades, configuration will be reset. If
> you use custom styles it is recommended that you use a new stylesheet and change
> `config.json` to point to your own style (rather than modify `default.css` directly).### Other Usages
Apart from a simple viewer, **MDV** can also work as a "markdown preview engine", with the following options:
* `-port`: use a specific port instead of randomly choose one
* `-serve`: do not open a browser window (let the editor handle it)## Markdown Features
* [GoldMark supported features](https://github.com/yuin/goldmark):
* Github-Flavored Markdown (Tables, Strikethrough, Linkify and TaskList)
* DefinitionList
* Footnotes
* Typographer
* Unsafe (parse embeded HTML tags)
* Table of Contents in collapsible side panel
* File selector in collapsible side panel
* MathJax support - nicely show math formular
* Sytax highlighting for common programming languages## Building Blocks
This tool utilizes the following excellent open source software:
* [yuin/goldmark ](https://github.com/yuin/goldmark): markdown parser for Go.
* [mdigger/goldmark-toc](https://github.com/mdigger/goldmark-toc): table of contents generator.
* [MathJax](https://www.mathjax.org/): beautiful and accessible math in all browsers.
* [highlight.js](https://highlightjs.org/): syntax highlighting for the Web.