Panserver

Screenshot

Panserver is a simple HTTP web server made for local use. It enables you to view your Markdown documents in rendered form in your web browser. Interesting features include table of contents, processing of inline diagrams, and auto-refresh. The latter ensures the views of documents will update themselves when the source documents are updated.

Visit the repository on Github. There you can find the source and usage documentation.

You can get an overview over the documents in your directory using the index. This way you can navigate to your file without typing out its path / URL. On the document pages you can also render them in slightly different formats better suited for exporting.

This program is written in Python 3. It uses the bottle library for HTTP-routing. The documents are rendered using pandoc. The rendered output is cached in a temporary directory to avoid rendering the same document twice.

Usage

Command line (given python is Python 3):

python panserver.py [-a] [-b] [-p port] [path]

This starts a local http server. The Markdown conversion utility pandoc must installed and available on the path. The python library bottle must be installed and available as well. No further dependencies or files are required; except for the mentioned dependencies, panserver.py is self-contained.

Hit Ctrl-c to stop the server.

Path

A path to the to the document directory. If no path is specified the current working directory is used. All files (not only Markdown documents) in the directory and all its subdirectories will be available through the server! This in necessary to allow you to link images (or scripts and stylesheets etc) in your documents.

Auto-refresh: -a

Specifying this option makes Panserver include a small script into the generated HTML. The script will constantly poll the server and refresh the page when the corresponding Markdown source file has been updated.

Open browser: -b

If you specify this option, Panserver will open its index page in your standard web browser.

Port: -p number

You can set the port Panserver should listen to with this option. The default is 8080.