Agreed. Let's begin working on some API design while Randall finishes sorting out the build kit and importing his libraries.
We can do that on the wiki, if that works: https://github.com/apache/incubator-annotator/wiki Cool? :) -----Original Message----- From: Gerben [mailto:[email protected]] Sent: Saturday, July 8, 2017 7:47 PM To: [email protected] Subject: Re: Precise-links browser extension On 2017-07-03 18:14, Benjamin Young wrote: > This is fabulous work, Gerben! Apologies for only just now following up. > > I'm curious--from both you and Randall--what it would take to make Apache > Annotator be the source of the libraries this Web extension depends on. I think it would take a rough consensus on how packages should be organised (with what scope and APIs etc.), and then a bit of coding to implement them. I'm happy to code some things, but don't want to waste time making stuff that others would consider e.g. out of scope. Perhaps we could start drafting API docs together to align our plans. > I know we still need to bring Randall's dom-anchor things "into the fold." > However, I'm also curious what's different between your packaged version of > the fragment identifier library and the one Randall did here. I'm guessing at > least the ES6-ification? They are nearly the same, but Randall did some more refactoring of the original code <https://github.com/w3c/web-annotation/tree/gh-pages/selector-note/converter> by Ivan Herman. I think we should agree on the desired API and merge them into one. > The next steps--we seem to be having a hard time taking--is getting these > libraries wrapped or added to the Apache Annotator repo + a similar factory > style wrapper like the one you and Sasha have both created. > > Help narrowing in on the differences will be useful. > > Also, pull requests more than welcome! :) > > Cheers! > Benjamin > > -----Original Message----- > From: Gerben [mailto:[email protected]] > Sent: Monday, May 29, 2017 3:20 PM > To: [email protected] > Subject: Precise-links browser extension > > Hi all, > > I have been silent here so far, but have been working a bit with Randall & > Benjamin on our shared webby ambitions, and thought I'll share this one for > your interests. At the I Annotate <https://iannotate.org> conference last > month I made a simple browser extension to support Web Annotation Selectors > in fragment identifiers, as specified in this W3C note > <https://www.w3.org/TR/2017/NOTE-selectors-states-20170223/#frags>. > A location such > ashttps://en.wikipedia.org/w/index.php?title=Koala&oldid=781295795#sel > ector(type=TextQuoteSelector,exact=fluffy%20ears) > <https://en.wikipedia.org/w/index.php?title=Koala&oldid=781295795#sele > ctor%28type=TextQuoteSelector,exact=fluffy%20ears%29> > will scroll to the words /fluffy ears/ and select them. > > *Technicalities:* > > The extension currently only supports TextQuoteSelectors using > dom-anchor-text-quote <https://github.com/tilgovi/dom-anchor-text-quote>, > which I abstracted through a minimal library I dub dom-anchor-selector > <https://github.com/Treora/dom-anchor-selector>, with the intention of adding > support for other selector types. I would be glad to have this library moved > or rewritten under the Apache Annotator umbrella if there is interest. > > The conversion between the selector as a javascript object and as a > fragment identifier is done by code borrowed from Ivan Herman's > converter > <http://w3c.github.io/web-annotation/selector-note/converter/>, > packaged as a module first by me here > <https://github.com/Treora/selector-state-frags>, and again by Randall > here > <https://github.com/apache/incubator-annotator/tree/master/packages/fr > agment-identifier> > under the Apache Annotator project. > > *Try it:* > > For Firefox, available here > <https://addons.mozilla.org/en-US/firefox/addon/precise-links/>. > > For Chromium, I yet only published it on my own server, here > <https://temp.treora.com/precise-links.crx> for now. To install, download it > and drag&drop the file to your list of extensions (chrome://extensions). > > To create link to a segment of text, right-click the selection and choose > 'Copy link to selected text'. > > *Improve it:* > > Extension code is here <https://github.com/Treora/precise-links>, though most > improvements are to be done in the dependencies mentioned above. > > It may be nice to also create a version of this code that people can easily > include in their web pages, something I did previously with quoteurl > <https://github.com/Treora/quoteurl>. > > Cheers, > > Gerben >
