README.md in standard-procedure-consolidate-0.1.0 vs README.md in standard-procedure-consolidate-0.1.1
- old
+ new
@@ -11,15 +11,23 @@
$ bundle add standard-procedure-consolidate
## Usage
+To list the merge fields within a document:
+
```ruby
Consolidate::Docx::Merge.open "/path/to/docx" do |merge|
+ puts merge.examine
+end and nil
+```
+To perform a merge, replacing merge fields with supplied values:
+
+```ruby
+Consolidate::Docx::Merge.open "/path/to/docx" do |merge|
merge.data "Name" => "Alice Aadvark", "Company" => "TinyCo", "Job_Title" => "CEO"
merge.write_to "/path/to/output.docx"
end
-
```
NOTE: The merge fields are case-sensitive - which is why they should be supplied as strings (using the older `{ "key" => "value" }` style ruby hash).
## Development