Skip to content

bootstrapDemoVault

Bootstraps a demo vault so its notes’ code-buttons work with no manual setup: installs CodeScript Toolkit from the community store (if it is not already installed), writes its settings, then enables it — writing the settings BEFORE enabling so a fresh enable loads it already configured, with no reload. If CodeScript Toolkit is already enabled but the settings just changed, it is reloaded (disabled then enabled) so it re-reads data.json; when the settings were already in place, nothing is reloaded (so a routine vault re-open does not re-run CodeScript Toolkit’s startup). CodeScript Toolkit then runs the vault’s startup.ts.

Import:

import { bootstrapDemoVault } from 'obsidian-dev-utils/obsidian/demo-vault-helper';

Signature:

function bootstrapDemoVault(params: BootstrapDemoVaultParams): Promise<void>

Parameters:

ParameterTypeDescription
paramsBootstrapDemoVaultParamsThe BootstrapDemoVaultParams.

Returns: Promise<void> — A Promise that resolves once CodeScript Toolkit is installed, configured, and enabled.


Links to this page: