]> gitweb.factorcode.org Git - factor.git/commitdiff
documents.elements: adding some documentation.
authorJohn Benediktsson <mrjbq7@gmail.com>
Thu, 3 Feb 2022 18:52:15 +0000 (10:52 -0800)
committerJohn Benediktsson <mrjbq7@gmail.com>
Thu, 3 Feb 2022 18:52:15 +0000 (10:52 -0800)
basis/documents/elements/elements-docs.factor

index 90c4a5f9e32170fac291a11fb4b9ed801e8dbd33..6d51f85b3eee1e093bedbc55babbfafb98ae6e62 100644 (file)
@@ -12,7 +12,12 @@ HELP: next-elt
 { $contract "Outputs the location of the first occurrence of the element following " { $snippet "loc" } "." } ;
 
 HELP: char-elt
-{ $class-description "An element representing a single character." } ;
+{ $class-description "An element representing a single character. The " { $link prev-elt } " and " { $link next-elt } " words return the location of the previous and next character from the current location." } ;
+
+HELP: one-char-elt
+{ $class-description "An element representing a single character. The " { $link prev-elt } " and " { $link next-elt } " words keep the location at this character." } ;
+
+{ one-char-elt char-elt } related-words
 
 HELP: one-word-elt
 { $class-description "An element representing a single word. The " { $link prev-elt } " and " { $link next-elt } " words return the location of the beginning and the end of the word at the current location." } ;
@@ -30,6 +35,12 @@ HELP: one-line-elt
 HELP: line-elt
 { $description "An element representing a single line. The " { $link prev-elt } " and " { $link next-elt } " words return the location of the previous and next line from the current location." } ;
 
+HELP: paragraph-elt
+{ $description "An element representing a single paragraph. The " { $link prev-elt } " and " { $link next-elt } " words return the location of the previous and next paragraph from the current location." } ;
+
+HELP: page-elt
+{ $description "An element representing a page of lines. The " { $link prev-elt } " and " { $link next-elt } " words return the location of the previous and next page of lines from the current location." } ;
+
 HELP: doc-elt
 { $class-description "An element representing the entire document. The " { $link prev-elt } " word outputs the start of the document and the " { $link next-elt } " word outputs the end of the document." } ;
 
@@ -38,11 +49,14 @@ ARTICLE: "documents.elements" "Document elements"
 $nl
 "The different types of document elements correspond to the standard editing taxonomy:"
 { $subsections
+    one-char-elt
     char-elt
     one-word-elt
     word-elt
     one-line-elt
     line-elt
+    paragraph-elt
+    page-elt
     doc-elt
 }
 "New locations can be created out of existing ones by finding the start or end of a document element nearest to a given location."