Class: OpenWebslides::Converter::Pressbooks
- Inherits:
-
Object
- Object
- OpenWebslides::Converter::Pressbooks
- Includes:
- Helpers::Sanitization
- Defined in:
- lib/openwebslides/converter/pressbooks.rb
Instance Attribute Summary collapse
-
#html ⇒ Object
Returns the value of attribute html.
-
#result ⇒ Object
Returns the value of attribute result.
Instance Method Summary collapse
-
#from_xhtml(html) ⇒ Result
Convert an XHTML document to Open Webslides.
Methods included from Helpers::Sanitization
Instance Attribute Details
#html ⇒ Object
Returns the value of attribute html.
11 12 13 |
# File 'lib/openwebslides/converter/pressbooks.rb', line 11 def html @html end |
#result ⇒ Object
Returns the value of attribute result.
11 12 13 |
# File 'lib/openwebslides/converter/pressbooks.rb', line 11 def result @result end |
Instance Method Details
#from_xhtml(html) ⇒ Result
Convert an XHTML document to Open Webslides
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/openwebslides/converter/pressbooks.rb', line 20 def from_xhtml(html) @html = Nokogiri::HTML html @result = Result.new root = Content::Root.new root.child_item_ids << parse_matter('front').id root.child_item_ids.concat parse_parts.map(&:id) root.child_item_ids << parse_matter('back').id result.content_items << root result end |