-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ability to use multiple layers of annotation. #21
Comments
The way this has been done in the past (afaik) is to keep references to the groups of DOM nodes that represent a single annotation--and juggle all the interleaved DOM nodes if/when anything changes. It's beyond inefficient, but it's what happens when you cram to trees together... So, from your example, you'd end up with something like this (pseudo code here also): <p><mark data-anno-id="3">Something </mark><mark data-anno-id="1"><mark data-anno-id="3"><mark data-anno-id="2">is</mark></mark><mark data-anno-id="3"> here</mark></mark></p>
<p><mark data-anno-id="345">And there's more text</mark> down here</p> Lovely, right? 😉 The text in each selection would be:
Presented as a tree this looks like: <p>
<mark data-anno-id="3">Something </mark>
<mark data-anno-id="1">
<mark data-anno-id="3">
<mark data-anno-id="2">is</mark>
</mark>
<mark data-anno-id="3"> here</mark>
</mark>
</p>
<p>
<mark data-anno-id="345">And there's more text</mark>
down here
</p> The DOM will think of (and treat) several of these |
This is helpful context for whomever wants to implement a highlighter, but we haven't got one yet. The demo adds Where does that leave us with this issue? Is there more to discuss here right now? Would it be helpful for me to leave it open? |
I think let's leave it open and begin planning/coding a highlighter. It's a super hard piece of this puzzle, and having that done will mean more annotation tools (built on Apache Annotator ta boot!). 😉 |
This kind of thing cannot be represented in a DOM easily, unless we have a tree and a way for each tree to just represent the index of the annotations in it.
Working in a DOM:
The cat is on the roof
Not working in a DOM:
...............
I was envisionning something similar to (not following any W3C recommendation here, just an idea)
Something is here
<annotation_layer>is</annotation_layer>
<annotation_layer>Something is here</annotation_layer>
<annotation_layer>Something is</annotation_layer>
<annotation_layer>is here</annotation_layer>
But copying the text over and over is probably not a good idea…
The text was updated successfully, but these errors were encountered: