Class: Docbook::Mirror::Handlers::Index
- Inherits:
-
Object
- Object
- Docbook::Mirror::Handlers::Index
- Defined in:
- lib/docbook/mirror/handlers/index.rb
Class Method Summary collapse
Class Method Details
.call(element, context:) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/docbook/mirror/handlers/index.rb', line 7 def self.call(element, context:) attrs = { xml_id: element.xml_id, title: context.resolve_title(element), }.compact content = [] if element.indexdiv&.any? element.indexdiv.each { |div| content << indexdiv_node(div) } end if element.indexentry&.any? element.indexentry.each do |entry| content << indexentry_node(entry) end end Node::IndexBlock.new(attrs: attrs, content: content) end |