On this page:
litchar
deftech
tech
defterm
onscreen
filepath
pkg
exec
exec_  flag
math
hash_  lang
9.0.0.6

4.3 Links and Literals🔗ℹ

function

fun litchar(str :: String)

 

function

fun litchar(strs :: List.of(String))

Renders str or the concatenated strs as literal text. In HTML and PDF, at least, a shared background is shown behind colored fixed-width font to emphasize that the text is intended literally.

function

fun deftech(pre_content :: PreContent,

            ~key: key :: maybe(String) = #false,

            ~normalize: normalize = #true,

            ~use_style: use_style = #true,

            ~index_extras: index_extras :: ExtrasMap = {})

  :: Element

 

function

fun tech(pre_content :: PreContent,

         ~key: key :: maybe(String) = #false,

         ~normalize: normalize = #true,

         ~doc: doc :: maybe(ModulePath) = #false,

         ~tag_prefixes: prefixes :: maybe(List.of(String)) = #false,

         ~indirect: indirect = #false,

         ~quiet: quiet = #true)

  :: Element

The deftech form renders as pre_content, and it establishes an anchor so that tech can refer to the technical term or phase with hyperlinking. As long as use_style is true, pre_content for deftech renders in a style (typically italic) to indicate that it is a technical term or phase.

When key is #false, the Content.to_string of pre_content after decoding is used as a key for reference. As long as normalize is true, then the key string is normalized as follows:

  • The string is case-folded.

  • A trailing ies is replaced by y.

  • A trailing s is removed.

  • Consecutive hyphens and whitespaces are all replaced by a single space.

These normalization steps help support natural-language references that differ slightly from a defined form. For example, a definition of bananas can be referenced with a use of banana.

use_style is true, then defterm is used on pre-content.

The index_extras argument is used in the same was as by indexed.

function

fun defterm(pre_content :: PreContent) :: Element

Renders pre_content in a style (typically italic) to indicate that it is a technical term or phase. Unlike deftech, defterm does not establish a target for references via tech.

function

fun onscreen(pre_content :: PreContent) :: Element

Renders pre_content in a style for labels in a GUI interface, such as menu names and button labels.

function

fun filepath(pre_content :: PreContent) :: Element

Renders pre_content as a file name: adding straight quotes and using a fixed-width font.

function

fun pkg(pre_content :: PreContent) :: Element

Renders pre_content as a package name: using a fixed-width font.

function

fun exec(content :: Content) :: Element

 

function

fun exec_flag(content :: Content) :: Element

The exec function renders content without decoding) as command-line input: using a fixed-width font.

The exec_flag function is similar, but it also disables line breaks, so that dashes for a command-line flag will not serve a points for breaking text across lines.

function

fun math(pre_content :: PreContent) :: Element

Renders pre_content with further transformations after decoding:

  • Any immediate curly apostrophe is converted to a prime character .

  • Parentheses and sequences of decimal digits in immediate strings are left as-is, but any other immediate string is italicized.

  • When _ appears before a non-empty sequence of numbers, letters, and -, the sequence is typeset as a subscript.

  • When ^ appears before a non-empty sequence of numbers, letters, and -, the sequence is typeset as a superscript.

function

fun hash_lang() :: Element

Renders as #lang with hyperlink to a description of the #lang syntax.