]> gitweb.factorcode.org Git - factor.git/blob - basis/documents/elements/elements-docs.factor
Merge OneEyed's patch
[factor.git] / basis / documents / elements / elements-docs.factor
1 USING: help.markup help.syntax documents ;
2 IN: documents.elements
3
4 HELP: prev-elt
5 { $values { "loc" "a pair of integers" } { "document" document } { "elt" "an element" } { "newloc" "a pair of integers" } }
6 { $contract "Outputs the location of the first occurrence of the element prior to " { $snippet "loc" } "." } ;
7
8 { prev-elt next-elt } related-words
9
10 HELP: next-elt
11 { $values { "loc" "a pair of integers" } { "document" document } { "elt" "an element" } { "newloc" "a pair of integers" } }
12 { $contract "Outputs the location of the first occurrence of the element following " { $snippet "loc" } "." } ;
13
14 HELP: char-elt
15 { $class-description "An element representing a single character." } ;
16
17 HELP: one-word-elt
18 { $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." } ;
19
20 { one-word-elt word-elt } related-words
21
22 HELP: word-elt
23 { $class-description "An element representing a single word. The " { $link prev-elt } " and " { $link next-elt } " words return the location of the previous and next word from the current location." } ;
24
25 HELP: one-line-elt
26 { $class-description "An element representing a single line. The " { $link prev-elt } " and " { $link next-elt } " words return the location of the beginning and the end of the line at the current location." } ;
27
28 { one-line-elt line-elt } related-words
29
30 HELP: line-elt
31 { $class-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." } ;
32
33 HELP: doc-elt
34 { $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." } ;
35
36 ARTICLE: "documents.elements" "Document elements"
37 "Document elements, defined in the " { $vocab-link "documents.elements" } " vocabulary, overlay a hierarchy of structure on top of the flat sequence of characters presented by the document."
38 $nl
39 "The different types of document elements correspond to the standard editing taxonomy:"
40 { $subsection char-elt }
41 { $subsection one-word-elt }
42 { $subsection word-elt }
43 { $subsection one-line-elt }
44 { $subsection line-elt }
45 { $subsection doc-elt }
46 "New locations can be created out of existing ones by finding the start or end of a document element nearest to a given location."
47 { $subsection prev-elt }
48 { $subsection next-elt } ;
49
50 ABOUT: "documents.elements"