[CHANGE] Randomized fill-in dynamic substitutions using Node

10 views
Skip to first unread message

D. Brian Walton

unread,
Jul 11, 2025, 11:26:11 AMJul 11
to PreTeXt announcements
A change was made behind the scenes in how the generated dynamic substitutions file for fill-in-the-blank problems with randomized elements are created. Previously, playwright used a headless browser and locally-hosted stand-alone html files for each problem. A new method was introduced that only loads the setup portion of the randomized problems using Node.js.

There is no change to the front-end.

This new method removes eliminates the need to open a temporary local html server, removes delays and timeouts relating to loading the html, and allows the creation of a simplified and better-formatted XML file containing the substitutions. [Note: This means the format of the dynamic-substitutions file—but not the actual substitutions—will change for projects previously generated.]

Requirements:
* Node is installed with minimum version v22.10
* A compatible version of npm is installed

The CLI will automatically verify requirements prior to generating the substitutions. Calling pretext/pretext directly with `-c dynamic` expects that `npm install` was previously run inside pretext/scripts/dynsub/.

Reply all
Reply to author
Forward
0 new messages