Project

mdprev

0.0
No commit activity in last 3 years
No release in over 3 years
Run files through markdown processor and open in a browser. Adds a default theme. Works with wkhtmltopdf.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

 Project Readme

Description

Styed preview of markdown files in browser or PDF viewer.

Installation

$ gem install mdprev

For PDF support, download [http://code.google.com/p/wkhtmltopdf/] and copy it into your /path/to/bin/wkhtmltopdf. Or you can configure mdprev to use another program. Here's an example of what to stick in your bashrc or zshrc:

MDPREV_CONVERT_PDF = 'htmldoc --webpage -f $output $input'

$output will be replcaed with the full path to the PDF name. $input will be replaced with an HTML document filename.

You can configure which command to use preview HTML/PDF files. By default it's open which works fine on OS X. For example usage with XFCE's thunar, just add these environment variables in your bashrc or zshrc:

MDPREV_OPEN_HTML = 'thunar'
MDPREV_OPEN_PDF  = 'thunar'

Usage

mdprev file1.md file2.md
mdprev file1.md file2.md --nav
mdprev file1.md --pdf

TODO

  • switch default to htmldoc
  • use htmldoc's page break system with h1s

License

Copyright (c) Hugh Bien, http://hughbien.com.

Released under BSD License, see LICENSE.md for more info.