Home

Awesome

Annotot

Build Status

Need to persist annotations quick and easily? Annotot, the original mini annotation API is for you. Don't annotate, annotot instead.

h/t @eefahy for the inspiration and name

This logo, "Annotot", is a derivative of "Sweet Potato Tator Tots" by Lisa Brettschneider used under CC BY-NC 2.0. "Annotot" is also licensed under CC BY-NC 2.0.

Usage

Annotot provides a simple RESTful endpoint for persisting annotations. Just configure your client to work with its endpoint.

For Mirador integration, you can use the provided AnnototEndpoint:

// Within Mirador creation options
...
annotationEndpoint: {
  name: 'Annotot',
  module: 'AnnototEndpoint',
  options: {
    endpoint: 'https://www.annotot.biz/annotot/annotations'
  }
},
...

If you want to configure Annotot to receive annotations from external sources make sure that you enable CORs in the Rails application. This can be done using rack-cors.

API

Annotot by default mounts itself at /. Though this can be changed. All API endpoints are relative to its mount location.

Path / UrlHTTP VerbPathController#Action
annotations_pathGET/annotations(.:format)annotot/annotations#index {:format=>:json}
POST/annotations(.:format)annotot/annotations#create {:format=>:json}
lists_annotations_pathGET/annotations/lists(.:format)annotot/annotations#lists {:format=>:json}
annotation_pathPATCH/annotations/:id(.:format)annotot/annotations#update {:format=>:json}
PUT/annotations/:id(.:format)annotot/annotations#update {:format=>:json}
DELETE/annotations/:id(.:format)annotot/annotations#destroy {:format=>:json}

annotations_path

GET - Return annotations for a given canvas

Parameters:

NameRequired?Description
uriyesCanvas uri for which to return annotations

POST - Create a new annotation

Parameters:

NameRequired?Description
annotationyesobject containing creation parameters
annotation.uuidnouuid for annotation
annotation.datanoannotation body data as string
annotation.canvasnocanvas to place the annotation on

lists_annotations_path

GET - Return an AnnotationList of annotations for a given canvas

Parameters:

NameRequired?Description
uriyesCanvas uri for which to return annotations

annotation_path

PATCH, PUT - Update an annotation

Parameters:

NameRequired?Description
idyesCanvas uri or Rails ActiveRecord id for annotation to update
annotationyesobject containing creation parameters
annotation.uuidnouuid for annotation
annotation.datanoannotation body data as string
annotation.canvasnocanvas to place the annotation on

DELETE - Delete an annotation

Parameters:

NameRequired?Description
idyesCanvas uri or Rails ActiveRecord id for annotation to delete

Installation

Add this line to your application's Gemfile:

gem 'annotot'

And then execute:

$ bundle install

Install the gem:

$ rails g annotot:install

If you are serving both Mirador and Annotot in the same application, the integration will be easier. You can just require the annotot_endpoint.js file.

//= require annotot/annotot_endpoint

License

The gem is available as open source under the terms of the Apache 2.0 License.