$code ( element -- )
Factor handbook » Developer tools » Help system » Writing documentation » Element types » Block elements

Prev:$io-error ( children -- )
Next:$curious ( element -- )


Vocabulary
help.markup

Inputs
elementa markup element of the form { string... }


Outputs
None

Word description
Prints code examples, as seen in many help articles. The markup element must be an array of strings.

Notes
The code becomes clickable if the output stream supports it, and clicking it opens a listener window with the text inserted at the input prompt.

If you want to show code along with sample output, use the $example element.

Examples
{ $code "2 2 + ." } print-element

2 2 + .


Definition