mbakeranalecta / sam

Semantic Authoring Markdown
Other
79 stars 8 forks source link

Programmatic access to object model #167

Open mbakeranalecta opened 6 years ago

mbakeranalecta commented 6 years ago

The development of the parser to date has focused on the ability to serialize a SAM document to XML. This does not require any kind of reference back into the document model because all such references are postponed to the application layer.

However, when coding the HTML output mode it became clear that the HTML output mode would be more useful if certain reference could be resolved for output. This includes:

In trying to code this, it became clear that the current object model does not make it easy to make query the document model, particularly from inside an object within that model.

There are different types of objects in the object model but there are certain operations you want to be able to do regardless of type. These include parent and child access and retrieving objects by id or name. This may call for a base object from which all DOM objects are derived.

I also think that it would be easier if attributes like ID and name were attributes of the blocks they belong to rather than being a collection of attribute objects. This would make access by ID much simpler.

mbakeranalecta commented 6 years ago

Attributes as attributes was implemented before 3e9b8f6fd8cddf9cbedb25c44ab48323216ce71e