0.0
No release in over 3 years
Extension of Prawndown to include additional Markdown features. Currently supports custom header sizes, fonts, and other properties; removing iframe content, and support for images and quotes.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

~> 2.5, >= 2.5.0
~> 3.6.1, >= 3.6.1
 Project Readme

prawndown-ext

Gem Version

An extension of Prawndown, used for Jekyll blogs (but can be used for other stuff too).

Usage

When using prawn, you can call the markdown method in your calls to render markdown.

content is the markdown content you want to render. options is a hash/dictionary of options that can modify how the text is rendered.

markdown (content, options: options)

Supported Markdown

Supports the following effects:

  • Header
  • Links
  • Bold, italic, strikethrough
  • Images
  • Quotes

Removes the following:

  • <iframe> references such as YouTube videos

Options

This is a list of possible options you can pass to prawndown-ext.

  • "header1_size" - Header 1 font size (default 28)
  • "header2_size" - Header 2 font size (default 24)
  • "header3_size" - Header 3 font size (default 20)
  • "header4_size" - Header 4 font size (default 18)
  • "header5_size" - Header 5 font size (default 16)
  • "header6_size" - Header 6 font size (default 14)
  • "header[1-6]_font" - The quote font name as defined in Prawn::Document.font_families used for headers.
  • "header[1-6]_margin" - The amount of margin on all sides the headers have (default 4)
  • "header[1-6]_line_spacing" - The amount of space in between lines on header text.
  • "quote_size" - Quoted text font size (default 14)
  • "quote_font" - The quote font name as defined in Prawn::Document.font_families used for quotes.
  • "quote_font_spacing" - Spacing between characters for quote font.
  • "quote_margin"" - The amount of margin on all sides the quotes have.
  • "default_line_spacing" - The amount of space in between lines on regular text.
  • "quote_line_spacing" - The amount of space in between lines on quote text.
  • "no_image" - If true, no images will be rendered.
  • "image_dir" - The base image directory to use for image references.

Extra Commands

These commands allow for more customization.

  • "<br><br>" - Creates a new page.

License

The gem is available as open source under the terms of the MIT License.

Other Stuff

Check out PetitFelix which uses prawndown-ext for producing printable PDFs from markdown pages.