diff --git a/basis/help/help-docs.factor b/basis/help/help-docs.factor index 47cc2987d7..643e121f5e 100755 --- a/basis/help/help-docs.factor +++ b/basis/help/help-docs.factor @@ -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." } ; diff --git a/basis/help/markup/markup.factor b/basis/help/markup/markup.factor index d65eb8fc88..d94b9c4b41 100755 --- a/basis/help/markup/markup.factor +++ b/basis/help/markup/markup.factor @@ -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) ;