docxtor2
Summary
Ruby docx generator
Installation
Add this line to your application's Gemfile:
gem 'docxtor2'
And then execute:
$ bundle
Or install it yourself as:
$ gem install 'docxtor2'
Usage
stream = Docxtor2.generate do
table_of_contents "Contents"
h 1, "heading1"
p "text1", :b => true do
style 'p1'
spacing :before => 80, :after => 240
italic; u
w "text2"
br
write "text3"
end
h 2 do
w "heading2"
line_break
write "some text"
br
write "another text"
end
p "content", :style => 'p2', :i => true, :align => 'center'
end
file = File.new('test.docx', 'w')
file.write(stream.string)
file.close
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
run tests:
turn -Itest test/lib