Class MaRuKu::MDElement
In: lib/maruku/defaults.rb
lib/maruku/ext/div.rb
lib/maruku/ext/math/elements.rb
lib/maruku/helpers.rb
lib/maruku/output/to_s.rb
lib/maruku/structures.rb
lib/maruku/structures_inspect.rb
lib/maruku/structures_iterators.rb
lib/maruku.rb
Parent: Object

I did not want to have a class for each possible element. Instead I opted to have only the class "MDElement" that represents eveything in the document (paragraphs, headers, etc).

You can tell what it is by the variable `node_type`.

In the instance-variable `children` there are the children. These can be of class 1) String or 2) MDElement.

The @doc variable points to the document to which the MDElement belongs (which is an instance of Maruku, subclass of MDElement).

Attributes are contained in the hash `attributes`. Keys are symbols (downcased, with spaces substituted by underscores)

For example, if you write in the source document.

    Title: test document
    My property: value

    content content

You can access `value` by writing:

    @doc.attributes[:my_property] # => 'value'

from whichever MDElement in the hierarchy.

Methods

Included Modules

REXML MaRuKu Out::Markdown Out::HTML Out::Latex Strings Helpers Errors

Attributes

doc  [RW]  Reference of the document (which is of class Maruku)
meta_priv  [RW] 

Public Class methods

Public Instance methods

Yields to each element of specified node_type All elements if e_node_type is nil.

Generate an id for headers. Assumes @children is set.

outputs abbreviated form (this should be eval()uable to get the document)

Apply passed block to each String in the hierarchy.

Strips all formatting from the string

[Validate]