vxml_pipeline/desugarers/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’ whose attrs include handle dictionary entries of the form:

handle=handle_name|page_flag|value|id|path

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.

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

On its way out it appends a 6th ‘used’ column to every GrandWrapper handle entry, recording whether the handle was referenced anywhere in the document:

handle=handle_name|page_flag|value|id|path|used handle=handle_name|page_flag|value|id|path|

(see 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.

pub const name: String
Search Document