add a markup element for slot names

document some markup words
db4
Doug Coleman 2008-09-05 18:29:29 -05:00
parent c44345e7a2
commit dd3dbf1b14
2 changed files with 17 additions and 1 deletions

View File

@ -14,6 +14,7 @@ ARTICLE: "span-elements" "Span elements"
{ $subsection $link } { $subsection $link }
{ $subsection $vocab-link } { $subsection $vocab-link }
{ $subsection $snippet } { $subsection $snippet }
{ $subsection $slot }
{ $subsection $url } ; { $subsection $url } ;
ARTICLE: "block-elements" "Block elements" ARTICLE: "block-elements" "Block elements"
@ -212,6 +213,18 @@ HELP: $code
{ $markup-example { $code "2 2 + ." } } { $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 HELP: $vocabulary
{ $values { "element" "a markup element of the form " { $snippet "{ word }" } } } { $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." } ; { $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." } ;

View File

@ -3,7 +3,7 @@
USING: accessors arrays definitions generic io kernel assocs USING: accessors arrays definitions generic io kernel assocs
hashtables namespaces parser prettyprint sequences strings hashtables namespaces parser prettyprint sequences strings
io.styles vectors words math sorting splitting classes slots 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 IN: help.markup
! Simple markup language. ! Simple markup language.
@ -61,6 +61,9 @@ M: f print-element drop ;
: $snippet ( children -- ) : $snippet ( children -- )
[ snippet-style get print-element* ] ($span) ; [ snippet-style get print-element* ] ($span) ;
! for help-lint
ALIAS: $slot $snippet
: $emphasis ( children -- ) : $emphasis ( children -- )
[ emphasis-style get print-element* ] ($span) ; [ emphasis-style get print-element* ] ($span) ;