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
Editordocumentation for details of editor extensions.
-
options.viewerExtensions¶ An array of viewer extensions. See the
Viewerdocumentation 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] });
An extension for the
Viewerthat displays any tags stored as an array of strings in the annotation’stagsproperty.Usage:
app.include(annotator.ui.main, { viewerExtensions: [annotator.ui.tags.viewerExtension] })
An extension for the
Editorthat allows editing a set of space-delimited tags, retrieved from and saved to the annotation’stagsproperty.Usage:
app.include(annotator.ui.main, { editorExtensions: [annotator.ui.tags.editorExtension] })