项目作者: agustinmista

项目描述 :
Minimalistic Markdown viewer/converter with built-in Css stylesheets support.
高级语言: Haskell
项目地址: git://github.com/agustinmista/mdviewer.git
创建时间: 2017-02-22T00:35:00Z
项目社区:https://github.com/agustinmista/mdviewer

开源协议:GNU General Public License v3.0

下载


mdviewer

CircleCI

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.

Installation

At the time, mdviewer can be installed both compiling it from source
using Stack, or downloading a precompiled binary provided by CircleCI

Prerequisites

Compiling from source using Stack

  1. git clone https://github.com/agustinmista/mdviewer
  2. cd mdviewer
  3. stack setup
  4. stack install gtk2hs-buildtools
  5. 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
$HOME/.local/share/mdviewer.

Downloading a precompiled binary

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.

  1. wget https://raw.githubusercontent.com/agustinmista/mdviewer/master/install.sh
  2. chmod +x install.sh
  3. ./install.sh

This method will copy the executable to $HOME/.local/bin and the data files
to $HOME/.local/share/mdviewer.

Usage

mdviewer currently supports three subcommands:

show

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.

Interactive controls

The current key-bindings mapping intends to provide a vim-like user
experience:

key description
e open file
w save as Html
r reload preview
n set next style
N set previous style
g go to page top
G go to page bottom
z go to previous page
x go to following page
q quit

convert

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.

list

mdviewer list

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.

  1. Available styles:
  2. * air
  3. * foghorn
  4. * ghostwriter
  5. * github
  6. * github-dark
  7. * godspeed
  8. * manuscript
  9. * markdown
  10. * ...

Acknowledgments

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!