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>
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/paru/filter/cite.rb', line 29 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 {|citation| citation.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.
45 46 47 48 49 50 |
# File 'lib/paru/filter/cite.rb', line 45 def ast_contents() [ @citations.map {|citation| citation.to_ast}, super ] end |