0.0
No commit activity in last 3 years
No release in over 3 years
Groff Parser and template engine for rails
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

Groff¶ ↑

Groff is another ruby pdf generator that doesn’t reinvent the wheel.

It use the always present groff command (on all macs and *nix), and ps2pdf from ghostscript package.

If you load it within rails, you will get a TemplateEngine for free

Some resources to get you started:

Installation¶ ↑

The recommended way is that you get the gem:

# add GitHub to your local list of gem sources:
gem sources -a http://gems.github.com/

# install the gem:
gem install guillermo-groff

Just add a simple require to the end of “config/environment.rb”:

gem 'guillermo-groff'
require 'groff'

That’s it. Remember to install the gem on all machines that you are deploying to.

Example usage¶ ↑

Create a view named index.pdf.groff with these content

.AUTHOR    "<%= author = %x(who am i).split(" ").first.capitalize %>"
.DOCTYPE    LETTER
.PRINTSTYLE TYPESET
.START
.DATE
<%= Time.now.strftime "%A, %d %b %Y %H:%M" %>
.TO
User of Groff
.FROM
Guillermo Álvarez
guillermo@cientifico.net
.GREETING
Hi
Enjoy using groff
.CLOSING
Bye

Authors and credits¶ ↑

Authors

Guillermo Álvarez <guillermo@cientifico.net>

Thanks

Willpaginate as I used as scaffold for the template engine and gem