|
1 |
| - |
| 1 | + |
2 | 2 |
|
3 |
| -# Label Studio Custom Scripts |
| 3 | +# Label Studio Plugins |
4 | 4 |
|
5 |
| -Welcome to **Label Studio Custom Scripts**! This repository contains `custom scripts` designed to extend the functionality of [Label Studio](https://labelstud.io), a powerful data labeling tool. These scripts can be used to automate workflows, integrate with external tools, and customize the labeling process according to your needs. |
| 5 | +Welcome to **Label Studio Plugins**! This repository contains `plugins` designed to extend the functionality of |
| 6 | +[Label Studio](https://labelstud.io), a powerful data labeling tool. These plugins can be used to automate workflows, |
| 7 | +integrate with external tools, and customize the labeling process according to your needs. |
6 | 8 |
|
7 |
| -Whether you're building custom data processors, integrations, or UI components, you'll find the necessary resources and examples in this repo to get started. |
| 9 | +Whether you're building custom data processors, integrations, or UI components, you'll find the necessary resources and |
| 10 | +examples in this repo to get started. |
8 | 11 |
|
9 | 12 | ## Official Documentation
|
10 | 13 |
|
11 |
| -For detailed documentation and guides on how to use and extend Label Studio with custom scripts, visit the official [Label Studio Scripts Documentation](https://docs.humansignal.com/guide/scripts). |
| 14 | +For detailed documentation and guides on how to use and extend Label Studio with plugins, visit the official |
| 15 | +[Label Studio Plugins Documentation](https://docs.humansignal.com/guide/plugins). |
12 | 16 |
|
13 | 17 | ## File Structure
|
14 | 18 |
|
15 |
| -This repository follows a clear folder structure to organize the various custom scripts and configuration files: |
| 19 | +This repository follows a clear folder structure to organize the various plugins and configuration files: |
16 | 20 |
|
17 | 21 | ```bash
|
18 |
| -label-studio-custom-scripts/ |
19 |
| -├── custom-scripts/ |
20 |
| -│ ├── script1/ |
| 22 | +label-studio-plugins/ |
| 23 | +├── src/ |
| 24 | +│ ├── plugin1/ |
21 | 25 | │ │ ├── data.{json|mp3|mp4}
|
22 |
| -│ │ ├── script.js |
| 26 | +│ │ ├── plugin.js |
23 | 27 | │ │ └── view.xml
|
24 |
| -│ ├── script2/ |
| 28 | +│ ├── plugin2/ |
25 | 29 | │ │ ├── data.{json|mp3|mp4}
|
26 |
| -│ │ ├── script.js |
| 30 | +│ │ ├── plugin.js |
27 | 31 | │ │ └── view.xml
|
28 | 32 | │ └── ...
|
29 | 33 | └── manifest.json
|
30 | 34 | ```
|
31 | 35 |
|
32 |
| -- **`/script1`**: Contains all the files to document a custom script. |
33 |
| - - Each script has a `script.js` and `view.xml` file that define the logic and UI of the script. |
34 |
| -- **`/script.js`**: Contains the actual custom script `javascript` file that can be embedded in the Label Studio code editor. |
35 |
| -- **`/view.xml`**: Stores an example of a `<View>` that will work along the script. |
36 |
| -- **`/data.{json|mp3|mp4}`**: Stores an example of the data that can be used along with the script. |
37 |
| -- **`manifest.json`**: This file lists the scripts, their metadata (title, description, etc.), and their paths for easy integration with Label Studio. |
| 36 | +- **`/plugin1`**: Contains all the files to document a plugin. |
| 37 | + - Each plugin has `plugin.js`, `view.xml`, and `data.json` files that define the logic, UI, and data of the plugin. |
| 38 | +- **`/plugin.js`**: Contains the actual `javascript` plugin file that can be embedded in the Label Studio code editor. |
| 39 | +- **`/view.xml`**: Stores an example of a `<View>` that will work along the plugin. |
| 40 | +- **`/data.{json|mp3|mp4}`**: Stores an example of the data that can be used along with the plugin. |
| 41 | +- **`manifest.json`**: This file lists the plugins, their metadata (title, description, etc.), and their paths for easy integration with Label Studio. |
38 | 42 |
|
39 | 43 | ## Usage
|
40 | 44 |
|
41 |
| -After your script gets merged you will be able to find it in your project's **Labeling Interface** |
| 45 | +After your plugin gets merged you will be able to find it in your project's **Labeling Interface** |
42 | 46 |
|
43 | 47 | 
|
44 | 48 |
|
45 | 49 | ## Contributing
|
46 | 50 |
|
47 |
| -We welcome contributions! Whether it's bug fixes or new scripts, feel free to open a pull request. Here's how you can get started: |
| 51 | +We welcome contributions! Whether it's bug fixes or new plugins, feel free to open a pull request. Here's how you can get started: |
48 | 52 |
|
49 | 53 | 1. **Create a new branch** for your feature or bugfix.
|
50 |
| -2. **Make your changes** and ensure that they adhere to the project's file structure and guidelines. You need to create a folder with the name using underscores (`path`) of your script and add a `view.xml` and a `script.js` file minimum. |
51 |
| -3. **Register the script** in the `manifest.json` adding the following information: |
| 54 | +2. **Make your changes** and ensure that they adhere to the project's file structure and guidelines. You need to create a folder with the name using underscores (`path`) of your plugin and add a `view.xml` and a `plugin.js` file minimum. |
| 55 | +3. **Register the plugin** in the `manifest.json` adding the following information: |
52 | 56 | ```json
|
53 | 57 | [
|
54 | 58 | {
|
55 |
| - "title": "Your script title", |
56 |
| - "description": "Your script description", |
57 |
| - "path": "exact_name_of_the_script_folder", // `script1` as per the File Structure example |
58 |
| - "private": false // whether you want to hide it in the "Insert Script" dropdown in the Configurator code tab |
| 59 | + "title": "Your plugin title", |
| 60 | + "description": "Your plugin description", |
| 61 | + "path": "exact-name-of-the-plugin-folder", // `plugin1` as per the File Structure example |
| 62 | + "private": false // whether you want to hide it in the "Insert Plugin" dropdown in the Configurator code tab |
59 | 63 | }
|
60 | 64 | ]
|
61 | 65 | ```
|
|
0 commit comments