From 7178d580a6daaf4cc66c0e107ab47b498650ed5c Mon Sep 17 00:00:00 2001 From: Jan Wille Date: Wed, 5 Mar 2025 16:14:50 +0100 Subject: [PATCH 1/2] add usage page for startup-scripts --- src/content/docs/guides/startupscripts.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/content/docs/guides/startupscripts.md diff --git a/src/content/docs/guides/startupscripts.md b/src/content/docs/guides/startupscripts.md new file mode 100644 index 0000000..ae5ea89 --- /dev/null +++ b/src/content/docs/guides/startupscripts.md @@ -0,0 +1,22 @@ +--- +title: Startup-Scripts +description: A guide on how to use startup-scripts. +--- + +JS-Engine supports startup-scripts, similar to the CSS-snippets from Core-Obsidian. + +You can select the script-file you want to use as startup-scripts and JS-Engine will run them for you when never Obsidian starts up. + +:::note +Different from Core-Obsidian, JS-Engine startup-scripts can not be stored inside the `.obsidian/` folder. +They need to be somewhere inside your vault. +::: + +## Configuring Startup-Scripts + +You can configure which files you want to have run from JS-Engines settings tab. + +## Global Variables + +JS-Engine runs the scripts in the same context as all other code-blocks. +So the available global variable are the same and can be found [here](/obsidian-js-engine-plugin-docs/api/classes/api/). From d32fb901c70fcd195c77f98820c4ec78b254e3b5 Mon Sep 17 00:00:00 2001 From: Jan Wille Date: Wed, 5 Mar 2025 16:15:53 +0100 Subject: [PATCH 2/2] update startup-scripts for new settings --- src/content/docs/guides/startupscripts.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/content/docs/guides/startupscripts.md b/src/content/docs/guides/startupscripts.md index ae5ea89..6f00ffb 100644 --- a/src/content/docs/guides/startupscripts.md +++ b/src/content/docs/guides/startupscripts.md @@ -15,6 +15,13 @@ They need to be somewhere inside your vault. ## Configuring Startup-Scripts You can configure which files you want to have run from JS-Engines settings tab. +There you will see a list of all JavaScript files detected inside the vault and +you can enable the ones you want to run at startup. + +### Setting a folder for startup-scripts + +To reduce the list of shown files you can define the name of a folder you use to store your scripts. +JS-Engine will only check that folder and only list files inside it as options. ## Global Variables