Class: Paru::PandocFilter::Header
- Includes:
- InnerMarkdown
- Defined in:
- lib/paru/filter/header.rb
Overview
A Header node has a level, an attribute object and the contents of the header as a list on Inline nodes.
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#ast_contents ⇒ Object
Create an AST representation of this Header node.
-
#has_inline? ⇒ Boolean
Has this Header node inline contents?.
-
#initialize(contents) ⇒ Header
constructor
Create a new Header node.
-
#inner_markdown ⇒ String
included
from InnerMarkdown
Get the markdown representation of this Node's children.
-
#inner_markdown=(markdown) ⇒ Object
included
from InnerMarkdown
Replace this Node's children with the Nodes represented by the markdown string.
Constructor Details
Instance Attribute Details
#attr ⇒ Attr
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/paru/filter/header.rb', line 33 class Header < Block include InnerMarkdown attr_accessor :level, :attr # Create a new Header node # # @param contents [Array] an array with the level, attribute, and # the header contents def initialize(contents) @level = contents[0] @attr = Attr.new contents[1] super contents[2], true end # Create an AST representation of this Header node def ast_contents() [ @level, @attr.to_ast, super ] end # Has this Header node inline contents? # # @return [Boolean] true def has_inline? true end end |
#level ⇒ Integer
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/paru/filter/header.rb', line 33 class Header < Block include InnerMarkdown attr_accessor :level, :attr # Create a new Header node # # @param contents [Array] an array with the level, attribute, and # the header contents def initialize(contents) @level = contents[0] @attr = Attr.new contents[1] super contents[2], true end # Create an AST representation of this Header node def ast_contents() [ @level, @attr.to_ast, super ] end # Has this Header node inline contents? # # @return [Boolean] true def has_inline? true end end |
Instance Method Details
#ast_contents ⇒ Object
Create an AST representation of this Header node
49 50 51 52 53 54 55 |
# File 'lib/paru/filter/header.rb', line 49 def ast_contents() [ @level, @attr.to_ast, super ] end |
#has_inline? ⇒ Boolean
Has this Header node inline contents?
60 61 62 |
# File 'lib/paru/filter/header.rb', line 60 def has_inline? true end |
#inner_markdown ⇒ String Originally defined in module InnerMarkdown
Get the markdown representation of this Node's children.
#inner_markdown=(markdown) ⇒ Object Originally defined in module InnerMarkdown
Replace this Node's children with the Nodes represented by the markdown string