factor/doc/handbook/help.facts

113 lines
5.2 KiB
Plaintext
Raw Normal View History

2006-08-17 23:08:04 -04:00
USING: help porter-stemmer ;
ARTICLE: "help" "The help system"
"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."
{ $subsection "browsing-help" }
{ $subsection "searching-help" }
2006-08-16 21:55:53 -04:00
{ $subsection "writing-help" }
{ $subsection "porter-stemmer" } ;
ARTICLE: "browsing-help" "Browsing documentation"
"The easiest way to browse the help is from the help browser tool in the UI, however you can also display help topics in the listener."
{ $subsection handbook }
"Help topics are identified by article name strings, or words. You can request a specific help topic:"
{ $subsection help }
"You can also view a word's documentation and definition at once:"
2006-06-20 23:05:26 -04:00
{ $subsection see-help } ;
ARTICLE: "searching-help" "Searching documentation"
"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."
{ $subsection search-help. }
"A lower-level word:"
{ $subsection search-help }
{ $subsection "searching-help-impl" } ;
ARTICLE: "searching-help-impl" "Full-text search implementation"
"The help system search engine is a very simple full-text indexer. The index is rebuilt with a call to this word:"
{ $subsection index-help }
"This indexes every help topic by first tokenizing the article content and discarding certain words,"
{ $subsection tokenize }
"and then by adding it to the index:"
{ $subsection index-text } ;
ARTICLE: "writing-help" "Writing documentation"
2006-10-26 00:06:25 -04:00
"By convention, documentation is written in files with the " { $snippet ".facts" } " filename extension. Module documentation should follow a few conventions documented in " { $link "documenting-modules" } "."
$terpri
"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."
{ $subsection "printing-elements" }
{ $subsection "element-types" } ;
ARTICLE: "printing-elements" "Printing markup elements"
"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:"
{ $subsection simple-element }
{ $subsection ($span) }
2006-06-20 23:05:26 -04:00
{ $subsection ($block) } ;
2006-08-16 21:55:53 -04:00
ARTICLE: "porter-stemmer" "Porter stemming algorithm"
"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:"
{ $subsection stem }
"The algorithm consists of a number of steps:"
{ $subsection step1a }
{ $subsection step1b }
{ $subsection step1c }
{ $subsection step2 }
{ $subsection step3 }
{ $subsection step4 }
{ $subsection step5 } ;