This is a reference implementation of the following pattern:
- Given a selection in a page, form the selectors needed to post an annotation that targets the selection.
- Lead a user through an interaction that influences the content of that annotation.
- Post the annotation.
This example runs from a bookmarklet.
You can "install" it by creating a bookmark with this text in the URL field:
javascript:(function(){var d=document; var s=d.createElement('script');s.setAttribute('src','https://jonudell.info/h/HelloWorldAnnotated/gather.js');d.head.appendChild(s)})();"
Screencast: http://jonudell.net/h/HelloWorldAnnotated.mp4
Blog post: https://blog.jonudell.net/2018/06/21/annotation-powered-apps-a-hello-world-example/