README.adoc in fb2rb-0.2.1 vs README.adoc in fb2rb-0.3.0
- old
+ new
@@ -35,20 +35,38 @@
$ gem install fb2rb
----
== Usage
+You can create FB2 book in memory and write it to file:
+
[source,ruby]
----
require 'fb2rb'
book = FB2rb::Book.new
book.description.title_info.book_title = 'Book title'
body = FB2rb::Body.new(nil, '<p>Book text</p>')
book.bodies << body
-book.write('/path/to/book.fb2.zip')
+book.write_compressed('/path/to/book.fb2.zip')
+# or
+book.write_uncompressed('/path/to/book.fb2')
+----
+
+Also, you can read existing FB2 file:
+
+[source,ruby]
+----
+require 'fb2rb'
+
+book = FB2rb::Book.read_compressed('/path/to/book.fb2.zip')
+# or
+book = FB2rb::Book.read_uncompressed('/path/to/book.fb2')
+
+puts book.description.title_info.book_title
+puts book.bodies[0].content
----
== Development
After checking out the repo, run `bundle install` to install dependencies.