3.7 Indexing
function | ||||||
| ||||||
| ||||||
function | ||||||
|
If words is a list of strings, then the first string in the list names the general index entry, the second is a more specific refinment of that entry, and so on. As index keys, the strings are “cleaned” by trimming leading and trailing whitespace, and also by converting non-empty sequences of whitespace to a single space character.
The extras argument provides optional information about an index entry. See ExtrasMap for more information.
The as_indexed function is a shorthand for calling indexed with the same text for pre_content and words. Specifically, Content.to_string is used to convert post-decoding pre_content to a single string to supply as words.
Use indexed or as_indexed when an index entry should point to a specific word or phrase within the typeset document. Use section_index, instead, to create an index entry that leads to a section, instead of a specific word or phrase within the section.
function | ||||
More precisely, section_indexed creates a PartDecl that is recognized during decoding in part mode.
annotation | |
#'#{language-family}: A PairList.of(ReadableString) describing language families for which this entry is relevant. If this key is missing, the default language-family list is PairList["Racket"], but title effectively makes the default PairList["Rhombus"] via part context (see below).
#'#{sort-order}: A Real that is used to order this entry with respect to others that have the same key. Smaller values of #'sort_order are shown before later values, and the default is 0.
#'kind: A ReadableString describing the binding’s category, such as "function" or "class". Like most other values in extras, this string is not added to the index entry’s main text as shown to a user, but it may be rendered by some interfaces, such as to the side or in hover text.
#'#{module-kind}: A Symbol indicating an entry for a module as documented with docmodule, where the symbol is #'lang for a module documented with ~lang and #'lib otherwise.
#'#{part?}: A Boolean indicating whether the index entry describes a section within a document.
#'#{hidden?}: A Boolean indicating that the index entry describes a binding that is covered from a user’s perspective by a different index entry. These are considered redundant and filtered from index rendering.
When index entries are recorded, the entry’s extras table can receive additional key–value mappings via part context using the #'#{index-extras} key. The title function puts a mapping for #'#{language-family} to PairList["Rhombus"] into the part context.