MD is a Thorfile to convert Markdown files to HTML and PDF versions.
The real power of MD Thorfile is that it uses a customizable HTML layout and CSS.
Features:
- convert .md to .html with layout and CSS styling
- convert .md to .pdf with layout and CSS styling
git clone git://github.com/synbioz/md.git
cd md
bundle install
thor md:setup # Copy default layout and css
thor install Thorfile
You can remove this clone since the Thorfile is installed system-wide.
On the command-line:
$ thor md:generate my_markdown_file.md # Generates "my_markdown_file.html"
$ thor md:generate my_markdown_file.md -f pdf # Generates "my_markdown_file.pdf"
MD can be configured through an Mdfile
placed in directory where you launch the command.
Mdfile
s have two purposes:
- Setting internal Markdown options through the
markdown_option
method, - Extending the default Markdown renderer by supplying a block to the
renderer
method.
For details about options and custom renderers, have a look at the Redcarpet docs.
Here is and example Mdfile
:
markdown_options no_links: true,
no_images: true
renderer do
def block_code(code, language)
"#{language}: <pre>#{code}</pre>"
end
end
If you want to contribute or report bugs you should take a look at:
Problems, comments, and suggestions are welcome on the issue tracker.
Copyright (c) 2011 Synbioz, released under the MIT license.