Projects and jolt.json
A JOLT project is a small static website: a set of text files saved together inside the document.
jolt.json project settings
index.html the app's page, rendered in JET
styles.css styles linked from the page
main.js ES modules; relative imports work
lib/util.js folders are fine
Paths use forward slashes and are relative to the project root. Files must be text. Binary files such as images aren't stored, so reference them by URL or as data URIs.
jolt.json
{
"name": "My JOLT App",
"entry": "index.html",
"autoRun": "main.js#autoRun",
"imports": { "lodash/": "https://esm.sh/lodash-es@4/" },
"launchUrl": "https://my-app.pages.dev/"
}
| Field | Default | Meaning |
|---|---|---|
name | "Untitled" | The app's name, shown on its tab in JET. |
entry | "index.html" | The page that JET renders. If the file doesn't exist, JET lists the project's automations instead. |
autoRun | none | A file#function reference, called once after the page is mounted. A function with one parameter receives the host context. An app started with an argument (my-app:alpha in JET, or ?arg=alpha) reads it as jolt.startArg. |
imports | none | An import map from bare names to URLs or project files. See Libraries. |
launchUrl | none | When set, JET runs the app at this URL instead of the embedded project. See JET. |
startApps | none | The JAM apps JET starts, each in its own tab, whenever the document opens: install codes such as "jam:jolt/workbook-map". JET writes it when someone ticks Start this app when this workbook opens. See Start apps automatically. |
The entry page
JET doesn't load index.html as a separate page. It mounts the page into the task pane:
<link rel="stylesheet" href="styles.css">pointing at a project file becomes an inline style. Links to other sites are kept as they are.<style>elements and the body's content are copied in.<script type="module">tags, withsrcor inline, load through JOLT's module loader, so imports between project files work. Classic scripts also run. Scripts run in document order, after the markup is in place.- Scripts from another site load like other code from other sites: listed on the app's approval screen, and while you build, after you trust the site (see Security).
Use jolt.$ and jolt.$$ rather than document.querySelector to find your app's elements. They search the app's own page, which is the portable way to find them in every view.
Running functions
JADE's function picker lists every exported function from every .js file:
export function f() {}is called with no arguments.export async function f(context) {}, with exactly one parameter, runs insideExcel.run,Word.runorPowerPoint.runand receives the request context.
From code, use jolt.run(fn) to get a context, and jolt.call("main.js", "f") to run another file's export the same way.
Automations
Put an @automation tag in a function's JSDoc comment to list it as an automation:
/** @automation Clean up — Trim spaces in the selected cells. */
export async function cleanUp(context) { … }
- The text before the separator is the title, and the text after it is the description. The separator can be an em dash (
—),-or a colon. - Automations are starred in JADE's picker. When a project has no entry page, JET shows them as buttons.
jolt.automations()lists them, so you can build your own menu.
Storage
The whole project, including its files, its jolt.storage data and a revision counter, is saved as compressed JSON (gzip and base64) in the document:
| Host | Where |
|---|---|
| Excel, Word, PowerPoint | A custom XML part with namespace urn:jolt:project:1. Every add-in can read it, which is how the separate JET add-in finds apps that were built with JOLT. |
| PowerPoint without PowerPointApi 1.7 | Document settings, which only the add-in that wrote them can read. Presentations saved this way by older JOLT builds move to the custom XML part the next time JADE saves them. |
Each save increases the project's revision number. JADE, JET and JUICE all use compare-and-swap, so a writer never overwrites a newer version without noticing. Nothing is kept until the document itself is saved in Office.