Basil.js – Code Completion and Documentation
Code completion, hover documentation and parameter hints for
basil.js, the Processing-style scripting
library for Adobe InDesign. Write .jsx scripts in VS Code and see what
rect(), textFont() or savePDF() expect without leaving the editor.
Made for the Critical Coding module at the Zurich University of the Arts
(ZHdK).
Features
- Completion for all basil.js functions, constants (
MM, CORNER,
LOREM, …) and variables (width, height). Required parameters are
inserted as placeholders: rect(x, y, w, h).
- Members after
Vector., HashList., CSV. and JSON..
- Hover documentation: summary, description, parameters, return value,
examples and a link to the online reference.
- Parameter hints while typing a call, with the current parameter
highlighted.
- Snippets:
basil (script with setup() / draw()), basil-loop
(looping script) and basil-batch (one page per image, PDF export).
- Command Basil.js: Open Reference opens the reference page of the
function under the cursor.
The extension is active only in files that include basil.js:
// @includepath "~/Documents/;%USERPROFILE%Documents";
// @include "basiljs/basil.js";
so React .jsx files stay untouched. Set basiljs.activation to
always to use it in every JavaScript file.
Settings
| Setting |
Default |
|
basiljs.activation |
auto |
auto: files that include basil.js; always: every JavaScript / JSX file |
basiljs.insertParameters |
true |
insert required parameters as placeholders |
Running scripts
This extension helps with writing. To run basil scripts, use InDesign's
Scripts panel or Adobe's
ExtendScript Debugger
for VS Code; both work together with this extension.
Version
Documentation of basil.js 2.0.0-beta (build 2025-01-19), generated from
the JSDoc comments in the library. basil.js is released under the MIT
license by the basil.js team.