Giter Club home page Giter Club logo

md's Introduction

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"

Theme edition

When working on themes, you need to edit styles in ~/.config/md/themes/. To render the .pdf each time you update styles you can use a watch :

watch ./render.sh ~/.config/md/themes/**

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.

md's People

Contributors

bounga avatar fuse avatar madx avatar nicoolas25 avatar seanselltl avatar victordarras avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.