highlightVars - speced/respec GitHub Wiki

highlightVars

Type: boolean Default: true

Enables click-to-highlight for <var> elements in algorithms. When a reader clicks a variable, all instances of that variable within the same section are highlighted, making it easier to trace variable usage through long algorithms.

Basic usage

var respecConfig = {
  highlightVars: false,
};

Notes

  • Variables must be marked up with <var> elements: Let <var>request</var> be a new request.
  • Highlighting is scoped to the nearest enclosing .algorithm list or <section> — whichever is closest
  • Clicking multiple variables gives each a distinct highlight color (up to 7 colors)
  • The |variable| shorthand automatically generates <var> elements
⚠️ **GitHub.com Fallback** ⚠️