]> gitweb.factorcode.org Git - factor.git/blob - extra/help/syntax/syntax-docs.factor
Initial import
[factor.git] / extra / help / syntax / syntax-docs.factor
1 USING: help.markup help.syntax vocabs ;
2
3 HELP: HELP:
4 { $syntax "HELP: word content... ;" }
5 { $values { "word" "a word" } { "content" "markup elements" } }
6 { $description "Defines documentation for a word." }
7 { $examples
8     { $code
9         ": foo 2 + ;"
10         "HELP: foo"
11         "{ $values { \"m\" \"an integer\" } { \"n\" \"an integer\" } }"
12         "{ $description \"Increments a value by 2.\" } ;"
13         "\\ foo help"
14     }
15 } ;
16
17 HELP: ARTICLE:
18 { $syntax "ARTICLE: topic title content... ;" }
19 { $values { "topic" "an object" } { "title" "a string" } { "content" "markup elements" } }
20 { $description "Defines a help article. String topic names are reserved for core documentation. Contributed modules should name articles by arrays, where the first element of an array identifies the module; for example, " { $snippet "{ \"httpd\" \"intro\" }" } "." }
21 { $examples
22     { $code
23         "ARTICLE: \"example\" \"An example article\""
24         "\"Hello world.\" ;"
25     }
26 } ;
27
28 HELP: ABOUT:
29 { $syntax "MAIN: article" }
30 { $values { "article" "a help article" } }
31 { $description "Defines the main documentation article for the current vocabulary." } ;
32
33 HELP: vocab-help
34 { $values { "vocab" "a vocabulary specifier" } { "help" "a help article" } }
35 { $description "Outputs the main help article for a vocabulary. The main help article can be set with " { $link POSTPONE: ABOUT:  } "." } ;