markserv serves Markdown files as GitHub style HTML and LiveReloads your changes in the browser as you edit.
markserv is designed to replace a Apache + Marked2 workflow.
I purchased Marked2 after seeing a colleage use it to edit markdown content. It looked awesome, but it felt clunky. And it didn't integrate with my almost constant CLI usage. While I found Marked2 to have a very well-rounded feature set, it was simply too slow, and too memory intensive.
Install the markserv server via npm.
npm install markserv -g
Change to the directory of your CLI
Start the HTTP markdown server in the current directory on port 8080
You should see something like this:
Click on the address link such as http://0.0.0.0:8080 in your terminal to open the browser and index the directory:
In the browser, click on a Markdown file, like "README.md", and markserv should render the Markdown file as HTML in your browser.
Watch your CLI for server hints:
Edit your markdown file, and you should now see the page reloading as you save your Markdown file. It should save your scroll position, which helps when editing extemely large documents.
You can link to an external Markdown file in the same way that you use GitHub Wiki links. You can use the example code here to see how external links work.
To list the options/flags for the markserv CLI tool:
You can serve content from a different path using the following command:
markserv -h /path/to/dir
You can change the HTTP Port like this:
markserv -p 80
markserv watches for file updates to the markdown file, and to the CSS directory, and automatically reloads the Markdown page via LiveReload. markserv remembers the scroll position you were at in the web browser, and reloads the page with the same scroll position when you make changes.
markserv was built for working on projects that contain a combination of web content and Markdown, where the markdown gets reloaded on the fly as the file is saved in your text editor. But it also serves regular HTTP content, replacing the need for a more bulky web server setup using MAMP, etc.
Markdown Icon | Octicon Icons by Github
File icon | Linecon by W3 Creative Labs
Folder icon | Hawcons by Yannick Lung