Rocx is a gem for creating .docx (Microsoft Word 2007) files. Using a simple API, you can create Word documents with:
- Paragraphs
- Titles
- Headings
- Page breaks
- Bullet points
- Tables
And, coming soon, images and more.
Add to your Rails application in the Gemfile:
gem 'rocx'
And then run:
bundle install
Or install it yourself:
gem install rocx
document = Rocx::Document.new do
title "TPS Report Cover Sheet"
table [
["Prepared by", ""]
["Date", ""]
["Product Code", ""]
["Customer", ""]
["Vendor", ""]
]
page_break
heading "Comments"
paragraph [["Comments", "b"], "should be", ["descriptive:", "u"]]
bullet "And if you could have this in by Friday, that would be great."
end
document.save("/path/where/it/should/be/saved.docx")
- Initial release
- Support for:
- Paragraphs
- Titles
- Headings
- Page breaks
- Bullet points
- Tables
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request