Module: Bindery::ContentMethods
- Included in:
- BookBuilder, Division
- Defined in:
- lib/bindery/content_methods.rb
Instance Method Summary collapse
- #appendix(title, filename, options = {}, &block) ⇒ Object
- #chapter(title, filename, options = {}, &block) ⇒ Object
-
#div(div_type, title, filename, options = {}) {|div| ... } ⇒ Object
Add a division to the book.
- #part(title, filename, options = {}, &block) ⇒ Object
- #section(title, filename, options = {}, &block) ⇒ Object
Instance Method Details
#appendix(title, filename, options = {}, &block) ⇒ Object
31 32 33 |
# File 'lib/bindery/content_methods.rb', line 31 def appendix(title, filename, ={}, &block) div('appendix', title, filename, , &block) end |
#chapter(title, filename, options = {}, &block) ⇒ Object
19 20 21 |
# File 'lib/bindery/content_methods.rb', line 19 def chapter(title, filename, ={}, &block) div('chapter', title, filename, , &block) end |
#div(div_type, title, filename, options = {}) {|div| ... } ⇒ Object
Add a division to the book.
The following options are supported:
- :body_only
-
the file contains only the body of the XHTML document, and Bindery should wrap it to create a valid document. Defaults to true.
10 11 12 13 14 15 16 17 |
# File 'lib/bindery/content_methods.rb', line 10 def div(div_type, title, filename, ={}) = {:body_only => true}.merge() raise ArgumentError, "title not specified" if title.nil? raise ArgumentError, "file not specified" if filename.nil? div = Division.new(div_type, title, filename, ) divisions << div yield div if block_given? end |
#part(title, filename, options = {}, &block) ⇒ Object
27 28 29 |
# File 'lib/bindery/content_methods.rb', line 27 def part(title, filename, ={}, &block) div('part', title, filename, , &block) end |
#section(title, filename, options = {}, &block) ⇒ Object
23 24 25 |
# File 'lib/bindery/content_methods.rb', line 23 def section(title, filename, ={}, &block) div('section', title, filename, , &block) end |