Class: Metanorma::Html::Component::IndexSection
- Defined in:
- lib/metanorma/html/component/index_section.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
css_dependencies, #element_attrs, #escape_html, #extract_block_label, #extract_plain_text, #extract_text_value, handled_classes, handles, #initialize, js_dependencies, register_in, #render_liquid, #render_mixed_content_in_order, #render_mixed_inline, requires_css, requires_js, #safe_attr
Constructor Details
This class inherits a constructor from Metanorma::Html::Component::Base
Instance Method Details
#render(collector, **_opts) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/metanorma/html/component/index_section.rb', line 7 def render(collector, **_opts) return if collector.nil? || collector.empty? quicknav = render_quicknav(collector.sorted_groups) letter_groups = render_letter_groups(collector.sorted_groups) content = quicknav + letter_groups attrs = %( id="index" class="index-section" data-component="index") index_html = render_liquid("_element.html.liquid", "tag" => "div", "extra_attrs" => attrs, "content" => content) renderer.register_toc_entry(id: "index", level: 1, text: "Index") index_html end |