| am_marks | R Documentation |
Retrieves all marks (formatting/metadata annotations) present in a text object at a specific document state.
am_marks(obj)
obj |
An Automerge object ID (must be a text object) |
A list of marks, where each mark is a list with fields:
Character string identifying the mark
The mark's value (various types supported)
Integer start position (0-based inter-character position, inclusive)
Integer end position (0-based inter-character position, exclusive)
Returns an empty list if no marks are present. See am_mark() for
indexing details.
doc <- am_create()
am_put(doc, AM_ROOT, "text", am_text("Hello World"))
text_obj <- am_get(doc, AM_ROOT, "text")
am_mark(text_obj, 0, 5, "bold", TRUE)
am_mark(text_obj, 6, 11, "italic", TRUE)
marks <- am_marks(text_obj)
marks
# List of 2 marks with name, value, start, end
am_close(doc)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.