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.
doc | [RW] | Reference of the document (which is of class Maruku) |
meta_priv | [RW] |