Class: Coradoc::Mirror::ReverseBuilder::Section

Inherits:
Base
  • Object
show all
Defined in:
lib/coradoc/mirror/reverse_builder.rb

Overview

All JS SECTION_TYPES reverse to a generic SectionElement. Style information lives in the original AsciiDoc and is preserved only on the forward side; the reverse side collapses them.

Instance Attribute Summary

Attributes inherited from Base

#context

Instance Method Summary collapse

Methods inherited from Base

#apply_mark, #build_content, #build_inline_children, #build_node, #extract_text, #initialize, #inline_content, registers

Constructor Details

This class inherits a constructor from Coradoc::Mirror::ReverseBuilder::Base

Instance Method Details

#build(node) ⇒ Object



103
104
105
106
107
108
109
110
111
# File 'lib/coradoc/mirror/reverse_builder.rb', line 103

def build(node)
  attrs = node.attrs
  CoreModel::SectionElement.new(
    title: attrs&.title,
    level: attrs&.level,
    id: attrs&.id,
    children: build_content(node)
  )
end