"The help system maintains documentation written in a simple markup language, along with cross-referencing and search. Documentation can either exist as free-standing " { $emphasis "articles" } " or be associated with words."
"The help system maintains a full-text term index. The easiest way to search the help is from the help browser tool in the UI, however you can also search in the listener."
"A pair of parsing words are used to define free-standing articles and to associate documentation with words:"
{ $subsection POSTPONE: ARTICLE: }
{ $subsection POSTPONE: HELP: }
"The " { $emphasis "content" } " in both cases is a " { $emphasis "markup element" } ", a recursive structure taking one of the following forms:"
{ $list
{ "a string," }
{ "an array of markup elements," }
{ "or an array of the form " { $snippet "{ $directive content... }" } ", where " { $snippet "$directive" } " is a markup word whose name starts with " { $snippet "$" } ", and " { $snippet "content..." } " is a series of markup elements" }
}
"Markup elements are therefore effectively just Factor objects, written using Factor syntax."
"When writing documentation, it is useful to be able to print markup elements for testing purposes. Markup elements which are strings or arrays of elements are printed in the obvious way. Markup elements of the form " { $snippet "{ $directive content... }" } " are printed by executing the " { $snippet "$directive" } " word with the element content on the stack."
{ $subsection print-element }
{ $subsection print-content } ;
ARTICLE: "element-types" "Element types"
"Markup elements can be classified into two broad categories, block elements and span elements. Block elements are inset with newlines before and after, whereas span elements flow with the paragraph text."
{ $subsection "span-elements" }
{ $subsection "block-elements" }
{ $subsection "markup-utils" } ;
ARTICLE: "span-elements" "Span elements"
{ $subsection $emphasis }
{ $subsection $link }
{ $subsection $snippet }
{ $subsection $url } ;
ARTICLE: "block-elements" "Block elements"
"The following are the standard headings found in word documentation:"
{ $subsection $values }
{ $subsection $description }
{ $subsection $contract }
{ $subsection $examples }
{ $subsection $warning }
{ $subsection $notes }
{ $subsection $side-effects }
{ $subsection $errors }
{ $subsection $see-also }
"Some additional elements:"
{ $subsection $code }
{ $subsection $curious }
{ $subsection $example }
{ $subsection $heading }
{ $subsection $links }
{ $subsection $list }
{ $subsection $markup-example }
{ $subsection $references }
{ $subsection $see }
{ $subsection $subsection }
{ $subsection $table } ;
ARTICLE: "markup-utils" "Markup element utilities"
"Utility words to assist in defining new elements:"
"The help system uses the Porter stemming algorithm to normalize words when building the full-text search index."
$terpri
"The Factor implementation of the algorithm is based on the Common Lisp version, which was hand-translated from ANSI C by Steven M. Haflich. The original ANSI C was written by Martin Porter."
$terpri
"A detailed description of the algorithm, along with implementations in various languages, can be at in " { $url "http://www.tartarus.org/~martin/PorterStemmer" } "."
$terpri
"The main word of the algorithm takes an English word as input and outputs its stem:"