factor/library/help/help.factor

30 lines
664 B
Factor
Raw Normal View History

2005-12-01 00:53:12 -05:00
IN: help
2005-12-01 00:58:39 -05:00
USING: arrays gadgets-presentations io kernel namespaces parser
sequences words ;
2005-12-01 00:53:12 -05:00
: help ( topic -- )
[
dup article-title $heading terpri terpri
article-content print-element terpri
] with-markup ;
: glossary ( name -- )
<term> help ;
: HELP:
scan-word
[ >array reverse "help" set-word-prop ] ; parsing
: ARTICLE:
[
>array reverse [ first2 2 ] keep
tail add-article
] ; parsing
[ word? ] "Show word documentation" [ help ] define-command
[ term? ] "Show term definition" [ help ] define-command
[ link? ] "Show article" [ help ] define-command
H{ } clone articles set
H{ } clone terms set