Skip to content

breadval/md

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MD

Description

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

Installation

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.

Usage

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"

Settings and customization

MD can be configured through an Mdfile placed in directory where you launch the command.

Mdfiles 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

Other

If you want to contribute or report bugs you should take a look at:

Problems, comments, and suggestions are welcome on the issue tracker.

Authors

  • Martin Catty (aka _fuse)
  • Nicolas Cavigneaux (aka Bounga)

Copyright (c) 2011 Synbioz, released under the MIT license.

About

Convert md to html, pdf…

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 62.5%
  • CSS 37.5%