mbakeranalecta / sam

Semantic Authoring Markdown
Other
79 stars 8 forks source link

Making annotation cancellation more specific #195

Closed mbakeranalecta closed 6 years ago

mbakeranalecta commented 6 years ago

Currently, annotation cancellation is global for the annotation type specified. That is,

Foo {bar}(bat "bam") foo {bar}-(bat)+(bonk) 

cancels the bat annotation on lookup even though that bat annotation has a specifically attribute that could be said to narrow its meaning (as would a namespace attribute).

We could make it so that the cancel would have to match the prior annotation exactly to cancel it:

Foo {bar}(bat "bam") foo {bar}-(bat "bam")+(bonk) 

This would allow for:

Foo {bar}(bat "bam")(bat "box") foo {bar}-(bat "bam")+(bonk) 

where the "bam" annotation would be cancelled and the "box" annotation would not.

The downside of this is that

Foo {bar}(bat "bam") foo {bar}-(bat)+(bonk)

says cancel any existing bat cancellation because I want to add my own, and does not require the writer to know what if any bat annotations may exist, the more specific form means the writer has to go look up what the last annotation was in order to cancel it.

Furthermore, if the last annotation is in an included file, and it part of the application design that the markup can be changed by switching in a different lookup file, then the more specific cancel would not work in all cases.

I am struggling to think of a realistic use case for the more specific cancel.

However, if there isn't one, then adding specifically and namespace attributes to a cancel annotation ought to be illegal, so as to avoid ambiguity.

mbakeranalecta commented 6 years ago

Implemented restriction on specifically and namespace attributes on cancel annotation in b3c3bb29c64fadad1f271d4bc34839469ba9a00d