ODF generation library for Ruby
Pull request Compare This branch is 50 commits behind thiagoarrais:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib/odf
spec
.darcsboring
.gitignore
CHANGELOG
LICENSE.LGPL
Manifest
README.rdoc
Rakefile
rodf.gemspec

README.rdoc

rODF

This is a library for writing to ODF output with Ruby. It currently only supports creating spreadsheets (ODS) and text documents (ODT). Slide shows (ODP) may be added some time in the future.

This is NOT an ODF reading library.

Installation

You should be able to install the latest stable version by saying something like

sudo gem install rodf

How do I use it?

rODF works pretty much like Builder, but with ODF-aware constructs. Try this:

require 'odf/spreadsheet'

ODF::Spreadsheet.file("my-spreadsheet.ods") do |spreadsheet|
  spreadsheet.table 'My first table from Ruby' do |table|
    table.row {|row|  row.cell 'Hello, rODF world!' }
  end
end

Some basic formatting is also possible:

require 'odf/spreadsheet'

ODF::Spreadsheet.file("my-spreadsheet.ods") do |spreadsheet|
  spreadsheet.style 'red-cell', :family => :cell do |style|
    style.property :text, 'font-weight' => 'bold', 'color' => '#ff0000'
  end
  spreadsheet.table 'Red text table' do |table|
    table.row {|row|  row.cell 'Red', :style => 'red-cell' }
  end
end