Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate PDF from markdown using pure ruby

Tags:

I'm currently using Kramdown to generate HTML from Markdown in Ruby. I know that I can generate a latex file using kramdown and convert it to pdf usaing a command line utility. But I want a pure ruby solution.

Is there a way to convert markdown to pdf using only ruby without using command-line utilities?

like image 798
Dimas Kotvan Avatar asked Dec 07 '10 14:12

Dimas Kotvan


People also ask

How do I turn a markdown into a PDF?

Usage. Just focus the window containing your markdown file and use the convert command ( Packages > Markdown PDF > Convert ). The output PDF will be styled similar to the markdown on github.com , as well as any user styles you have added.

How do you install prawns?

Installing Prawn Prawn is distributed via RubyGems, and can be installed the usual way that you install gems: by simply typing gem install prawn on the command line.


2 Answers

You can use https://github.com/walle/gimli

I made it just for this purpose. Though, I use textile. But gimli supports all formats supported by GitHub-Markup.

like image 197
Fredrik Wallgren Avatar answered Oct 27 '22 04:10

Fredrik Wallgren


Prawn: The Pure Ruby PDF Generation Library
http://www.rubyinside.com/prawn-ruby-pdf-library-987.html

like image 42
Robert Harvey Avatar answered Oct 27 '22 04:10

Robert Harvey