]> gitweb.factorcode.org Git - factor.git/commitdiff
add a markup element for slot names
authorDoug Coleman <doug.coleman@gmail.com>
Fri, 5 Sep 2008 23:29:29 +0000 (18:29 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Fri, 5 Sep 2008 23:29:29 +0000 (18:29 -0500)
document some markup words

basis/help/help-docs.factor
basis/help/markup/markup.factor

index 47cc2987d770eb3ec2ba9f30e4cffb8868da3208..643e121f5eee9e6cf2edabf757dda2ec9344b543 100755 (executable)
@@ -14,6 +14,7 @@ ARTICLE: "span-elements" "Span elements"
 { $subsection $link }
 { $subsection $vocab-link }
 { $subsection $snippet }
+{ $subsection $slot }
 { $subsection $url } ;
 
 ARTICLE: "block-elements" "Block elements"
@@ -212,6 +213,18 @@ HELP: $code
     { $markup-example { $code "2 2 + ." } }
 } ;
 
+HELP: $nl
+{ $values { "children" "unused parameter" } }
+{ $description "Prints a paragraph break. The parameter is unused." } ;
+
+HELP: $snippet
+{ $values { "children" "markup elements" } }
+{ $description "Prints a key word or otherwise notable snippet of text, such as a type or a word input parameter. To document slot names, use " { $link $slot } "." } ;
+
+HELP: $slot
+{ $values { "children" "markup elements" } }
+{ $description "Prints a tuple slot name in the same way as a snippet. The help tool can check that there exists an accessor with this name." } ;
+
 HELP: $vocabulary
 { $values { "element" "a markup element of the form " { $snippet "{ word }" } } }
 { $description "Prints a word's vocabulary. This markup element is automatically output by the help system, so help descriptions of parsing words should not call it." } ;
index d65eb8fc88ccf2974c2e0481fd8deb7e76da62a9..d94b9c4b41c7dbfeae4d1f5d30b7048a09c25741 100755 (executable)
@@ -3,7 +3,7 @@
 USING: accessors arrays definitions generic io kernel assocs
 hashtables namespaces parser prettyprint sequences strings
 io.styles vectors words math sorting splitting classes slots
-vocabs help.stylesheet help.topics vocabs.loader ;
+vocabs help.stylesheet help.topics vocabs.loader alias ;
 IN: help.markup
 
 ! Simple markup language.
@@ -61,6 +61,9 @@ M: f print-element drop ;
 : $snippet ( children -- )
     [ snippet-style get print-element* ] ($span) ;
 
+! for help-lint
+ALIAS: $slot $snippet
+
 : $emphasis ( children -- )
     [ emphasis-style get print-element* ] ($span) ;