redcarpet.rb

lib/tilt/redcarpet.rb

Markdown (markdown, md, mkd)

Markdown is a lightweight markup language, created by John Gruber and Aaron Swartz. For any markup that is not covered by Markdown’s syntax, HTML is used. Marking up plain text with Markdown markup is easy and Markdown formatted texts are readable.

Example

Hello Markdown Templates
========================

Hello World. This is a paragraph.

Usage

To wrap a Markdown formatted document with a layout:

layout = Tilt['erb'].new do
  "<!doctype html><title></title><%= yield %>"
end
data = Tilt['md'].new { "# hello tilt" }
layout.render { data.render }
# => "<!doctype html><title></title><h1>hello tilt</h1>\n"

Options

:smartypants => true|false

Set true to enable [Smarty Pants] style punctuation replacement.

:escape_html => true|false

Set true disallow raw HTML in Markdown contents. HTML is converted to literal text by escaping < characters.

See also

Required files

  1. redcarpet