You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+30-11Lines changed: 30 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# docx
2
2
3
-
a ruby library/gem for interacting with `.docx` files
3
+
a ruby library/gem for interacting with `.docx` files. currently capabilities include reading paragraphs/bookmarks, inserting text at bookmarks, and saving the document.
4
4
5
5
## usage
6
6
@@ -10,15 +10,33 @@ requires ruby (only tested with 1.9.3 so far)
10
10
11
11
gem install docx
12
12
13
-
### basic
13
+
### reading
14
14
15
15
```ruby
16
16
require'docx'
17
17
18
18
d =Docx::Document.open('example.docx')
19
-
d.each_paragraph do |p|
19
+
# Array of paragraphs
20
+
d.paragraphs.each do |p|
20
21
puts d
21
22
end
23
+
24
+
# Hash of Bookmarks. Bookmark names as keys correspond to bookmark objects.
25
+
d.bookmarks.each_pair do |bookmark_name, bookmark_object|
0 commit comments