vxml_pipeline/desugarers/writerly_handles_grand_wrapper_substitute

Values

pub fn constructor(
  param: #(
    String,
    String,
    String,
    List(#(String, String)),
    List(#(String, String)),
    List(String),
    List(String),
  ),
) -> core.Desugarer

Expects a document with root ‘GrandWrapper’ containing structured Handle children with name, page, value, id, and path attrs.

Replaces in-text >>handle_name occurrences and href=>>handle_name attrs by links. The produced link tag and attrs depend on whether the handle’s path equals the current local path. A handle using #page links to the page path without appending #id.

A backslash immediately before ‘>>’ escapes the operator. Odd backslash runs produce literal text; even runs leave the usage active. Each pair of source backslashes becomes one literal backslash.

Writerly code-block contents are left untouched: definitions are recognized there by the definition desugarer, but usages remain literal and do not mark their target handles as used.

This desugarer does not rewrite href=#id links and does not remove the GrandWrapper node.

On its way out it adds a boolean used attr to every Handle child.

(see writerly_handles_grand_wrapper_warn_unused, which consumes that column).

Inside any descendant of a tag named in the last param entry (typically “Math” and “MathBlock”) the substitution is made in place as plain text, as a LaTeX

\href{<target_path>}{}

fragment, rather than as a link V-node: MathJax parses the text content of those nodes as TeX source, and an element node sitting in the middle of it is fed to the TeX parser as literal markup. If the occurrence is immediately wrapped in unspaced parens, both parens are absorbed into the \href value, so the whole “(2.5)” is clickable. An unassigned handle falls back to its #decoy: value if present and otherwise becomes plain ‘undefined handle: ’ text, warning in both cases.

The #page, #decoy:, and terminal ## usage suffixes are VXML Pipeline extensions rather than parts of a Writerly handle name.

pub const name: String
Search Document