annotator.ui package

annotator.ui.main([options])

A module that provides a default user interface for Annotator that allows users to create annotations by selecting text within (a part of) the document.

Example:

app.include(annotator.ui.main);
Parameters:options (Object) –
options.element

A DOM element to which event listeners are bound. Defaults to document.body, allowing annotation of the whole document.

options.editorExtensions

An array of editor extensions. See the Editor documentation for details of editor extensions.

options.viewerExtensions

An array of viewer extensions. See the Viewer documentation for details of viewer extensions.

annotator.ui.markdown.render(annotation)

Render an annotation to HTML, converting annotation text from Markdown if Showdown is available in the page.

Returns:Rendered HTML.
Return type:String
annotator.ui.markdown.viewerExtension(viewer)

An extension for the Viewer. Allows the viewer to interpret annotation text as Markdown and uses the Showdown library if present in the page to render annotations with Markdown text as HTML.

Usage:

app.include(annotator.ui.main, {
    viewerExtensions: [annotator.ui.markdown.viewerExtension]
});
annotator.ui.tags.viewerExtension(viewer)

An extension for the Viewer that displays any tags stored as an array of strings in the annotation’s tags property.

Usage:

app.include(annotator.ui.main, {
    viewerExtensions: [annotator.ui.tags.viewerExtension]
})
annotator.ui.tags.editorExtension(editor)

An extension for the Editor that allows editing a set of space-delimited tags, retrieved from and saved to the annotation’s tags property.

Usage:

app.include(annotator.ui.main, {
    editorExtensions: [annotator.ui.tags.editorExtension]
})