The vendored pele bundle

What pele is in devpage — a third-party JavaScript bundle copied into the repository that draws Mermaid diagrams in the browser — where it came from, its version and licences, how devpage calls it, and how to upgrade it. It is a mechanism page under the viewer, for someone about to replace the bundle or change how diagrams are drawn; how to write a diagram is in Diagrams.

What is in the repository

File What it is
assets/vendor/pele.js The bundle, minified, one file.
assets/vendor/pele.LICENSE Its licence text.

The bundle's first line is its only provenance record:

/*! Pele 1.10.0 | MIT License | https://github.com/obsidianmd/pele */

So the version is 1.10.0, the source is that GitHub repository, and the licence is MIT. pele.LICENSE holds the MIT text (copyright kepano) and a second notice the bundle's header doesn't mention: the reset icon of pele's zoom controls is Lucide's rotate-ccw icon (Lucide v1.14.0), under the ISC licence. No other file records which commit or release archive the bundle was taken from.

How devpage uses it

src/server.rs compiles the bundle into the binary with include_str! and serves it at /__devpage/pele.js — see built-in assets. Every page loads it before devpage.js. One function of it is used, by the Diagram system widget (assets/widgets/Diagram.tsx) that every <pre lang="mermaid"> block is mounted as: pele.render(source) returns an object whose svg string the widget renders, and a thrown error becomes the diagram error block. The bundle exports more — zoom controls, mounting, registering diagram types — and devpage calls none of it.

pele colors its SVG with --pele-* CSS variables; assets/style.css sets them from devpage's theme tokens on every .diagram. The mapping is in How diagrams follow the theme.

Upgrading it

There is no package manager step and no script; an upgrade is done by hand:

  1. Replace the files Put the new bundle at assets/vendor/pele.js and its licence at assets/vendor/pele.LICENSE. Check the new header line and the licence for the version and for any newly bundled third-party notices.

  2. Rebuild and restart The bundle is embedded with include_str!, so a running devpage keeps serving the old one until it is rebuilt and restarted (cargo run -- docs, or cargo install --path . again for an installed copy).

  3. Re-run the diagram check Run the Node command in Diagrams over every page that holds a diagram, and confirm each diagram renders and each one's click count equals its link count.

    $ grep -rl '```mermaid' docs

  4. Re-check the --pele-* mapping List the variables the new bundle reads and compare them with the ones assets/style.css sets. A variable the stylesheet doesn't set keeps pele's own default, which doesn't follow devpage's light and dark tokens, so look at a diagram in both themes.

    $ grep -o -- '--pele-[a-z-]' assets/vendor/pele.js | sort -u $ grep -o -- '--pele-[a-z-]' assets/style.css | sort -u

  5. Update the docs The pages that name the version — this page and Diagrams.

Which variables the 1.10.0 bundle reads, and which devpage leaves at pele's defaults, is listed once, in How diagrams follow the theme.