Skip to content

Commit 1b083c7

Browse files
authored
Merge pull request #9 from HumanSignal/fb-leap-1984/rename-plugins
feat: LEAP-1984: Rename Custom Scripts to Plugins
2 parents 5e8cbbd + 719e8ee commit 1b083c7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+892
-794
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
## Checklist
1010

1111
- [ ] I have tested the changes in the Label Studio Labeling Config.
12-
- [ ] I have added the `script.js` file.
12+
- [ ] I have added the `plugin.js` file.
1313
- [ ] I have added the `view.xml` file.
1414
- [ ] My code follows the guidelines stated in the README.md.
1515

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Validate Plugins
2+
3+
on:
4+
push:
5+
branches: ["**"]
6+
pull_request:
7+
branches: ["**"]
8+
9+
jobs:
10+
validate-structure:
11+
name: Validate File Structure
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout Repository
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: 20
21+
22+
- name: Run Folder Structure Check
23+
run: node validate-structure.mjs
24+
linting:
25+
name: Linting
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
31+
- name: Setup Biome
32+
uses: biomejs/setup-biome@v2
33+
with:
34+
version: latest
35+
36+
- name: Run Biome
37+
run: biome ci .

.github/workflows/validate-structure.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

README.md

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,65 @@
1-
![Label Studio Custom Scripts](docs/banner.png)
1+
![Label Studio Plugins](docs/banner.png)
22

3-
# Label Studio Custom Scripts
3+
# Label Studio Plugins
44

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.
68

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.
811

912
## Official Documentation
1013

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).
1216

1317
## File Structure
1418

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:
1620

1721
```bash
18-
label-studio-custom-scripts/
19-
├── custom-scripts/
20-
│ ├── script1/
22+
label-studio-plugins/
23+
├── src/
24+
│ ├── plugin1/
2125
│ │ ├── data.{json|mp3|mp4}
22-
│ │ ├── script.js
26+
│ │ ├── plugin.js
2327
│ │ └── view.xml
24-
│ ├── script2/
28+
│ ├── plugin2/
2529
│ │ ├── data.{json|mp3|mp4}
26-
│ │ ├── script.js
30+
│ │ ├── plugin.js
2731
│ │ └── view.xml
2832
│ └── ...
2933
└── manifest.json
3034
```
3135

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.
3842

3943
## Usage
4044

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**
4246

4347
![Labeling Interface](docs/labeling-interface.png)
4448

4549
## Contributing
4650

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:
4852

4953
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:
5256
```json
5357
[
5458
{
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
5963
}
6064
]
6165
```

custom-scripts/bulk-labeling/data.json

Lines changed: 0 additions & 10 deletions
This file was deleted.

custom-scripts/bulk-labeling/script.js

Lines changed: 0 additions & 27 deletions
This file was deleted.

custom-scripts/count-words-in-textarea/data.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

custom-scripts/count-words-in-textarea/script.js

Lines changed: 0 additions & 22 deletions
This file was deleted.

custom-scripts/different-images-per-label/data.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

custom-scripts/different-images-per-label/script.js

Lines changed: 0 additions & 48 deletions
This file was deleted.

custom-scripts/llm-backend/script.js

Lines changed: 0 additions & 103 deletions
This file was deleted.

custom-scripts/markdown-to-html/data.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)