mdviewer is a minimalistic GTK+ Markdown viewer/converter written in Haskell. It supports using Css stylesheets both from a built-in styles repository or from user provided Css files. It is also possible to export files to Html embedding the selected style into a single self-contained file.
At the time, mdviewer can be installed both compiling it from source using Stack, or downloading a precompiled binary provided by CircleCI
git clone https://github.com/agustinmista/mdviewer cd mdviewer stack setup stack install gtk2hs-buildtools stack install
The installation will usually copy the executable to
$HOME/.local/bin, so it
is important that you have appended it to your PATH. Other data files such as
the styles repository are copied into your Xdg data folder. This is usually
This process is automated by the
install.sh bash script which downloads
a precompiled binary from the latest CircleCI build, and the data files from
this GitHub repository using Subversion. Make sure you have installed wget
and svn before running the installer.
wget https://raw.githubusercontent.com/agustinmista/mdviewer/master/install.sh chmod +x install.sh ./install.sh
This method will copy the executable to
$HOME/.local/bin and the data files
mdviewer currently supports three subcommands:
mdviewer show [input] [-s STYLE]
This subcommand launches an interactive WebKit based window where you can use
the supported key-bindings to open files, change styles, navigate following
links and so on. If you run
mdviewer show without specifying an input file,
a welcome file is shown.
The current key-bindings mapping intends to provide a vim-like user experience:
||save as Html|
||set next style|
||set previous style|
||go to page top|
||go to page bottom|
||go to previous page|
||go to following page|
mdviewer convert input [-o OUTPUT] [-s STYLE]
This subcommand converts a Markdown file into an Html file which optionally embeds an Css stylesheet. If no output file is specified, then the output is saved to input.html.
This subcommand lists the Css stylesheets currently available at the styles
repository; you can choose any of them by using the
-s/--style flag followed
by a style name when calling to
show/convert subcommands. If you want to use
an external Css stylesheet instead, just use the
-s/--style flag providing
the path to it and mdviewer will add it to the built-in styles repository
for future usage automatically.
Available styles: * air * foghorn * ghostwriter * github * github-dark * godspeed * manuscript * markdown * ...
I would like to say thanks to some of the authors of the Css stylesheets built-in into mdviewer:
Please, if you find this software useful don't doubt to give any feedback. PRs are welcome!