Sha256: cec2c94e586355318c22d6c35bc97d6c032986f60f9a465a9830bc21252ba5a6

Contents?: true

Size: 1.01 KB

Versions: 1

Compression:

Stored size: 1.01 KB

Contents

module MaRuKu
  # This represents the whole document and holds global data.
  class MDDocument # < MDElement
    # @return [{String => {:url => String, :title => String}}]
    attr_accessor :refs

    # @return [{String => MDElement}]
    attr_accessor :footnotes

    # @return [{String => String}]
    attr_accessor :abbreviations

    # Attribute definition lists.
    #
    # @return [{String => AttributeList}]
    attr_accessor :ald

    # The order in which footnotes are used. Contains the id.
    #
    # @return [Array<String>]
    attr_accessor :footnotes_order

    # @return [{String => {String => MDElement}}]
    attr_accessor :refid2ref

    # A counter for generating unique IDs [Integer]
    attr_accessor :id_counter

    def initialize(s=nil)
      super(:document)

      self.doc = self
      self.refs = {}
      self.footnotes = {}
      self.footnotes_order = []
      self.abbreviations = {}
      self.ald = {}
      self.refid2ref = {}
      self.id_counter = 0

      parse_doc(s) if s
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
maruku-0.7.3 lib/maruku/document.rb