Module: Metanorma::StandardDocument::OrderedContent
- Included in:
- Sections::AnnexSection, Sections::ClauseSection
- Defined in:
- lib/metanorma/standard_document/block_attributes.rb
Overview
Provides blocks method for ordered-content section types.
Returns child block-level nodes in document order via each_mixed_content,
excluding metadata/inline elements like titles and annotations.
Constant Summary collapse
- NON_BLOCK_TYPES =
[ Metanorma::Document::Components::Inline::TitleWithAnnotationElement, Metanorma::Document::Components::Inline::FmtTitleElement, Metanorma::Document::Components::Inline::VariantTitleElement, Metanorma::Document::Components::Inline::FmtXrefLabelElement, Metanorma::Document::Components::Inline::FmtAnnotationStartElement, Metanorma::Document::Components::Inline::FmtAnnotationEndElement, ].freeze
Instance Method Summary collapse
Instance Method Details
#blocks ⇒ Object
67 68 69 70 71 72 73 74 75 76 77 78 79 |
# File 'lib/metanorma/standard_document/block_attributes.rb', line 67 def blocks @blocks ||= begin result = [] each_mixed_content do |node| next if node.is_a?(String) next if NON_BLOCK_TYPES.any? { |t| node.is_a?(t) } result << node end result end end |