Clean Start
This commit is contained in:
commit
5bee381ea7
30
README.md
Normal file
30
README.md
Normal file
@ -0,0 +1,30 @@
|
||||
# SillyTavern Extension Example
|
||||
|
||||
Provide a brief description of how your extension works, what problem it aims to solve.
|
||||
|
||||
## Features
|
||||
|
||||
Describe some of the main selling points of your extension.
|
||||
|
||||
## Installation and Usage
|
||||
|
||||
### Installation
|
||||
|
||||
In most cases, this should just be using ST's inbuilt extension installer.
|
||||
|
||||
### Usage
|
||||
|
||||
Explain how to use this extension.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Specify the version of ST necessary here.
|
||||
|
||||
## Support and Contributions
|
||||
|
||||
Where should someone ask for support?
|
||||
How can they help add to this extension?
|
||||
|
||||
## License
|
||||
|
||||
Be cool, use an open source license.
|
2
example.html
Normal file
2
example.html
Normal file
@ -0,0 +1,2 @@
|
||||
<!-- You might want to add additional HTML elements to ST.
|
||||
It's good practice to seperate it out from your code -->
|
35
index.js
Normal file
35
index.js
Normal file
@ -0,0 +1,35 @@
|
||||
// The main script for the extension
|
||||
// The following are examples of some basic extension functionality
|
||||
|
||||
//You'll likely need to import extension_settings, getContext, and loadExtensionSettings from extensions.js
|
||||
import { extension_settings, getContext, loadExtensionSettings } from "../../../extensions.js";
|
||||
|
||||
// Keep track of where your extension is located
|
||||
const extensionName = "example-extension";
|
||||
const extensionFolderPath = `scripts/extensions/third-party/${extensionName}/`;
|
||||
const extensionSettings = extension_settings[extensionName];
|
||||
|
||||
|
||||
function onButtonClick() {
|
||||
// This function is called when the button is clicked
|
||||
// You can do whatever you want here
|
||||
}
|
||||
|
||||
// This function is called when the extension is loaded
|
||||
jQuery(async () => {
|
||||
// This is an example of loading HTML from a file
|
||||
const settingsHtml = await $.get(
|
||||
`${extensionFolderPath}/example.html`
|
||||
);
|
||||
|
||||
// Append settingsHtml to extensions_settings
|
||||
// extension_settings and extensions_settings2 are the left and right columns of the settings menu
|
||||
// You can append to either one
|
||||
$("#extensions_settings").append(settingsHtml);
|
||||
|
||||
// These are examples of listening for events
|
||||
$("#my_button").on("click", onButtonClick());
|
||||
|
||||
// Load settings when starting things up (if you have any)
|
||||
loadSettings();
|
||||
});
|
11
manifest.json
Normal file
11
manifest.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"display_name": "Name Displayed in SillyTavern",
|
||||
"loading_order": 9,
|
||||
"requires": [],
|
||||
"optional": [],
|
||||
"js": "index.js",
|
||||
"css": "style.css",
|
||||
"author": "yourNameHere",
|
||||
"version": "1.0.0",
|
||||
"homePage": "yourUrlHere"
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user