README.md in htmltoword-0.2.1 vs README.md in htmltoword-0.4.0
- old
+ new
@@ -1,9 +1,7 @@
# Ruby Html to word Gem [![Code Climate](https://codeclimate.com/github/nickfrandsen/htmltoword.png)](https://codeclimate.com/github/nickfrandsen/htmltoword) [![Build Status](https://travis-ci.org/nickfrandsen/htmltoword.png)](https://travis-ci.org/nickfrandsen/htmltoword)
-## OBS: This repository is no longer being maintained. Please take a look at https://github.com/karnov/htmltoword
-
This simple gem allows you to create MS Word docx documents from simple html documents. This makes it easy to create dynamic reports and forms that can be downloaded by your users as simple MS Word docx files.
Add this line to your application's Gemfile:
gem 'htmltoword'
@@ -23,21 +21,21 @@
Using the default word file as template
```ruby
require 'htmltoword'
my_html = '<html><head></head><body><p>Hello</p></body></html>'
-file = Htmltoword::Document.create my_html, file_name
+document = Htmltoword::Document.create(my_html)
```
Using your custom word file as a template, where you can setup your own style for normal text, h1,h2, etc.
```ruby
require 'htmltoword'
# Configure the location of your custom templates
Htmltoword.config.custom_templates_path = 'some_path'
my_html = '<html><head></head><body><p>Hello</p></body></html>'
-file = Htmltoword::Document.create my_html, file_name, word_template_file_name
+document = Htmltoword::Document.create(my_html, word_template_file_name)
```
### With Rails
**For htmltoword version >= 0.2**
An action controller renderer has been defined, so there's no need to declare the mime-type and you can just respond to .docx format. It will look then for views with the extension ```.docx.erb``` which will provide the HTML that will be rendered in the Word file.