Class: Paru::PandocFilter::Cite
- Defined in:
- lib/paru/filter/cite.rb
Overview
A Cite node, consisting of a list of Citation nodes, and a list of Inline nodes
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#ast_contents ⇒ Object
Create an AST representation of this Cite node.
-
#initialize(contents) ⇒ Cite
constructor
Create a new Cite node.
Constructor Details
Instance Attribute Details
#citations ⇒ Array<Citation>
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/paru/filter/cite.rb', line 31 class Cite < Inline attr_accessor :citations # Create a new Cite node # # @param contents [Array] an array containing a list of citations # and a list of inline nodes def initialize(contents) super(contents[1]) @citations = [] contents[0].each do |citation| @citations.push Citation.new(citation) end end # Create an AST representation of this Cite node. def ast_contents [ @citations.map(&:to_ast), super ] end # undef_method :inner_markdown # undef_method :inner_markdown= end |
Instance Method Details
#ast_contents ⇒ Object
Create an AST representation of this Cite node.
47 48 49 50 51 52 |
# File 'lib/paru/filter/cite.rb', line 47 def ast_contents [ @citations.map(&:to_ast), super ] end |