Narrative version of the core paradigm (currently PoC-ed in perl, and version with edit-in-place interface and navigation shown at https://www.youtube.com/watch?v=4ZfsyTPYFIA):
A Tree of Records
Given a tree of Records based at a “Root” where each Record is:
a hash of key/values and
a list of other Records referenced with/without Prefixes (the syntax is OptionalPrefix=[OtherRecord])
Record Features
Assuming
Each Record has a unique name
The keys are more or less any string, case-sensitive, without leading or trailing whitespace (syntax is Key Name=ValueAsAString)
The values are strings and may contain {Entities} and <HTML> markup.
Rendering
Given an input of:
the name of a Root1
the name of a Record1
the name of a Key1
a desired View
Return a string which is:
The Value of the Key1, recursively expanding any {Entities}
By replacing the {Entities} with the Value of the first matching Key
Matching an Entity with a Key
General
Search for the Key in Record1, or in a linked Record, inquiring depth-first
The search for a match always starts at the top, from Record1. (Enabling modification by overides.)
Prefixing:
Linked Records: When searching a Prefixed linked Record (Buyer.=[AcmeInc.md]) treat each of the KeyNames in the linked Record (AcmeInc.md) as if the KeyName was Prefixed (e.g. Name=Acme is treated as Buyer.Name=Acme).
Entities in Prefixed Records: If an {Entity} is in a Prefixed Record, then treat the {Entity} as being {PrefixEntity}. E.g. if we are in Record1, look for {Buyer.Name}, don’t find Buyer.Name=Something in Record1, then look in AcmeInc.md, we might find Name=Acme. In which case the match is made. If we look for {Buyer.President.Name} in Record1, then AcmeInc.md and find a link there to President.=[JonesJ.md] then a key Name=Jones would satisfy. If in JonesJ.md Name={First.Name} then we would have a match, but would then be looking for {Buyer.President.Name.First} again starting from Record1, then {President.Name.First} in AcmeInc.md, then (if not found) for Name.First in JonesJ.md. If still not found then deprefixing would occur.
Deprefixing: If there is no match for {Buyer.President.Name.First}, then look for {Buyer.Name.First} and then for {Name.First}. (Note - this deprefixing has nothing to do with the periods, it works the same for {BuyerPresidentName}, if the references are Buyer=[Record2], President=[Record3]. The periods are characters like any other.) (Note that the deprefixing starts from the rightmost Prefix and peels them off from the right recursively.). (Note also that this example of Buyer.President.Name.First ends up looking for some non-sensicle matches, including Name.First in the AcmeInc.md Record and in Record1, but this is still the needed behavior.)
Failure to Find a Match
View: Metadata Wrapping Each Substitution