Locally view markdown files in a browser.
Starts a local server to render "markdown" files within your browser:
- Runs on
localhost:4000
- Supports Markdown Syntax with GFM.
- Markdown rendering based on markdown-it.
Enabled Plugins for:- Emojis
- Task lists
- Footnotes
- Includes markedpp as preprocessor.
- Supports syntax highlighting using highlight.js
- For supported markdown Syntax see Cheatsheet.
- Automatic update in browser after saving edited file. (Tested on Linux, MacOS, Windows)
npm install -g md-fileserver
In your terminal type:
mdstart
Note: The local server can only be reached from your local computer on port 4000. Any remote access from other computers to your files is denied.
Open http://localhost:4000 in your browser and navigate to the markdown file.
Alternatively type in your terminal:
mdopen <file>
This will open the default browser with the processed markdown file.
mdopen test/cheatsheet.md
In config.js
you can change several settings to fit your needs. These include:
- Browser: Default browser of MacOS, Linux or Windows is used.
- Style: Styles are located in
./assets/
. Currently only a GFM like style is supported. Others are welcome. - Markdown options: Change the options how markdown-it processes your markdown files.
- Markdown PP options: Change the options how markedpp pre-processes your markdown files.
Install personalized version:
- Clone this repo
git clone https://github.com/commenthol/md-fileserver.git cd md-fileserver
- Make your changes in
./config.js
- Install with
npm i -g
from same folder.
If there are issues with installing you'll need to uninstall first withnpm un -g
If you contribute code to this project, you are implicitly allowing your code to be distributed under the MIT license. You are also implicitly verifying that all code is your original work.
Copyright (c) 2016-present commenthol
Software is released under MIT License.