commit | c8597333ec34c19d34c065504ecaae727fa6086f | [log] [tgz] |
---|---|---|
author | Randall Leeds <randall@apache.org> | Sun Jun 30 09:40:35 2019 -0700 |
committer | Randall Leeds <randall@apache.org> | Sun Jun 30 09:40:35 2019 -0700 |
tree | 0c9737878aaf8632bd284ee2e561ef89a235554d | |
parent | 90fb586e4fa1177cc3da9b68f6d4c5aedcea86b4 [diff] |
Refactor @annotator/dom to be DOM-centric Refactor @annotator/dom to accept Node and Range as the selector scope and to yield Range matches. Rather than try to fit the DOM selectors into the shape of a RegExp match, focus on the the DOM as the way to model selector scopes and matches. Refinement becomes straightforward because it can now expect that any refinable selector can accept its matches as scopes. The range selector implemenattion gets simpler, too. Yielding Range objects directly from the DOM selectors means that callers can more easily work with the matches without dealing with DOM text traversal.
Apache Annotator provides annotation enabling code for browsers, servers, and humans.
We‘re currently pre-releasing development copies of each library that makes up the sum total of Apache Annotator’s code. You can grab any of them from our npm organization.
$ # for example... $ npm install --save @annotator/dom
We use Lerna to juggle the various Apache Annotator libraries. If you‘d like to contribute, you’ll need the following:
$ yarn install
$ yarn test
$ yarn start
Once the test server has started, you can browse a local demo, and run tests in a browser by visiting http://localhost:8080/
.
If you have any Web Annotation Data Model JSON documents, you can validate them using the validate
script:
$ yarn validate --url https://raw.githubusercontent.com/w3c/web-annotation-tests/master/tools/samples/correct/anno1.json
With the --url
option you can pass in a URL or a local path to a JSON file.
Valid:
https://raw.githubusercontent.com/w3c/web-annotation-tests/master/tools/samples/correct/anno1.json
Invalid:
https://raw.githubusercontent.com/w3c/web-annotation-tests/master/tools/samples/incorrect/anno1.json
Apache License 2.0