Project

annotot

0.01
No release in over 3 years
Low commit activity in last 3 years
Annotot. Open annotations in Rails.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

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 / Url HTTP Verb Path Controller#Action
annotations_path GET /annotations(.:format) annotot/annotations#index {:format=>:json}
POST /annotations(.:format) annotot/annotations#create {:format=>:json}
lists_annotations_path GET /annotations/lists(.:format) annotot/annotations#lists {:format=>:json}
annotation_path PATCH /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:

Name Required? Description
uri yes Canvas uri for which to return annotations

POST - Create a new annotation

Parameters:

Name Required? Description
annotation yes object containing creation parameters
annotation.uuid no uuid for annotation
annotation.data no annotation body data as string
annotation.canvas no canvas to place the annotation on

lists_annotations_path

GET - Return an AnnotationList of annotations for a given canvas

Parameters:

Name Required? Description
uri yes Canvas uri for which to return annotations

annotation_path

PATCH, PUT - Update an annotation

Parameters:

Name Required? Description
id yes Canvas uri or Rails ActiveRecord id for annotation to update
annotation yes object containing creation parameters
annotation.uuid no uuid for annotation
annotation.data no annotation body data as string
annotation.canvas no canvas to place the annotation on

DELETE - Delete an annotation

Parameters:

Name Required? Description
id yes Canvas 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.