Class: Coradoc::CoreModel::InlineElement
- Includes:
- ChildrenContent
- Defined in:
- lib/coradoc/core_model/inline_element.rb
Overview
Generic inline formatting element
Represents all inline text formatting in AsciiDoc:
-
Bold (text or text)
-
Italic (text or __text__)
-
Monospace (‘text` or “text“)
-
Subscript (~text~)
-
Superscript (^text^)
-
Underline ([underline]#text#)
-
Small ([small]#text#)
-
Links
-
Cross-references
-
Footnotes
Inline elements can be nested within each other, allowing for complex formatting like bold italic text.
Constant Summary collapse
- FORMAT_TYPES =
Canonical set of format_type values produced by ToCoreModel transformers. Extended types (text, span, break, etc.) are produced only by HTML input converters.
%w[ bold italic monospace underline strikethrough subscript superscript highlight link xref stem footnote hard_line_break ].freeze
Instance Attribute Summary collapse
-
#constrained ⇒ Boolean
Whether the formatting uses constrained syntax (true for text, false for text).
-
#content ⇒ String?
Text content of the element.
-
#format_type ⇒ String?
Type of inline formatting (e.g., ‘bold’, ‘italic’, ‘monospace’, ‘link’, ‘xref’).
-
#nested_elements ⇒ Array<InlineElement>?
Nested inline formatting.
-
#stem_type ⇒ String?
Stem notation type (e.g., ‘latexmath’, ‘asciimath’, ‘stem’).
-
#target ⇒ String?
Target URL or reference (for links, xrefs).
Attributes inherited from Base
#element_attributes, #id, #metadata_entries, #title
Method Summary
Methods included from ChildrenContent
#children=, #flat_text, included, #initialize, #renderable_content, #to_hash
Methods inherited from Base
#accept, #attr, #metadata, #semantically_equivalent?, #set_attr, #set_metadata
Instance Attribute Details
#constrained ⇒ Boolean
Returns whether the formatting uses constrained syntax (true for text, false for text).
66 |
# File 'lib/coradoc/core_model/inline_element.rb', line 66 attribute :constrained, :boolean, default: -> { true } |
#content ⇒ String?
Returns text content of the element.
70 |
# File 'lib/coradoc/core_model/inline_element.rb', line 70 attribute :content, :string |
#format_type ⇒ String?
Returns type of inline formatting (e.g., ‘bold’, ‘italic’, ‘monospace’, ‘link’, ‘xref’).
61 |
# File 'lib/coradoc/core_model/inline_element.rb', line 61 attribute :format_type, :string |
#nested_elements ⇒ Array<InlineElement>?
Returns nested inline formatting.
74 |
# File 'lib/coradoc/core_model/inline_element.rb', line 74 attribute :nested_elements, InlineElement, collection: true |
#stem_type ⇒ String?
Returns stem notation type (e.g., ‘latexmath’, ‘asciimath’, ‘stem’).
82 |
# File 'lib/coradoc/core_model/inline_element.rb', line 82 attribute :stem_type, :string |
#target ⇒ String?
Returns target URL or reference (for links, xrefs).
78 |
# File 'lib/coradoc/core_model/inline_element.rb', line 78 attribute :target, :string |