Passage

com.alecdorrington.annotatedtextformat.dom.Passage
See thePassage companion object
final class Passage

A stretch of a page, beneath root: its text nodes, and the elements within it that are not prose, as code, each of which stands in its text as one Passage.placeholder, so that the text on either side of it is not taken as side by side. An element that a decoration put there stands as the text it shows, as a translation, so that a page decorated a piece at a time reads as it is seen, though nothing within it may be annotated again. Each <br>, and each boundary between blocks within it, as paragraphs, stands in its text as a line break. Annotations of the passage are of its text.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def annotate[A](annotations: List[Annotation[A]]): Either[List[Problem], AnnotatedText[A]]

annotations of its text, if they fit it, or else what is wrong.

annotations of its text, if they fit it, or else what is wrong.

Attributes

def offsetOf(node: Node, offset: Int): Option[Int]

Where offset within node lies in its text, if node is one of its text nodes, or within an element that is not prose, as a decoration's, where a reader may select what it shows, or an element whose child at offset, or else whose end, is at one.

Where offset within node lies in its text, if node is one of its text nodes, or within an element that is not prose, as a decoration's, where a reader may select what it shows, or an element whose child at offset, or else whose end, is at one.

A passage is of the page as it was when read, so these, spanOf and rangeOf find nothing in what has changed since, as text nodes that a decoration has split; read it again, then, as Passage(root).

Attributes

def rangeOf(span: TextSpan): Option[Range]

A range of the page over span of its text, if both its ends are at its text nodes: the start at the start of the text after it, and the end at the end of the text before it, or at either, at a point.

A range of the page over span of its text, if both its ends are at its text nodes: the start at the start of the text after it, and the end at the end of the text before it, or at either, at a point.

Attributes

def spanOf(range: Range): Option[TextSpan]

The span in its text of range, as of what the reader selects, if both its ends are at its text nodes.

The span in its text of range, as of what the reader selects, if both its ends are at its text nodes.

Attributes

Concrete fields

val original: String

Its text as the page held it before any decoration: that of its text nodes, what each element of a decoration took the place of, and a placeholder for each other element, as for the words around a passage. Its offsets are not those of text.

Its text as the page held it before any decoration: that of its text nodes, what each element of a decoration took the place of, and a placeholder for each other element, as for the words around a passage. Its offsets are not those of text.

Attributes

val root: Node
val text: String

Its text: that of its text nodes, what each element of a decoration shows, and a placeholder for each other element.

Its text: that of its text nodes, what each element of a decoration shows, and a placeholder for each other element.

Attributes