Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
## Checklist

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

Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/validate-plugins.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Validate Plugins

on:
push:
branches: ["**"]
pull_request:
branches: ["**"]

jobs:
validate-structure:
name: Validate File Structure
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20

- name: Run Folder Structure Check
run: node validate-structure.mjs
linting:
name: Linting
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Biome
uses: biomejs/setup-biome@v2
with:
version: latest

- name: Run Biome
run: biome ci .
22 changes: 0 additions & 22 deletions .github/workflows/validate-structure.yml

This file was deleted.

56 changes: 30 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,61 +1,65 @@
![Label Studio Custom Scripts](docs/banner.png)
![Label Studio Plugins](docs/banner.png)

# Label Studio Custom Scripts
# Label Studio Plugins

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.
Welcome to **Label Studio Plugins**! This repository contains `plugins` designed to extend the functionality of
[Label Studio](https://labelstud.io), a powerful data labeling tool. These plugins can be used to automate workflows,
integrate with external tools, and customize the labeling process according to your needs.

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

## Official Documentation

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).
For detailed documentation and guides on how to use and extend Label Studio with plugins, visit the official
[Label Studio Plugins Documentation](https://docs.humansignal.com/guide/plugins).

## File Structure

This repository follows a clear folder structure to organize the various custom scripts and configuration files:
This repository follows a clear folder structure to organize the various plugins and configuration files:

```bash
label-studio-custom-scripts/
├── custom-scripts/
│ ├── script1/
label-studio-plugins/
├── src/
│ ├── plugin1/
│ │ ├── data.{json|mp3|mp4}
│ │ ├── script.js
│ │ ├── plugin.js
│ │ └── view.xml
│ ├── script2/
│ ├── plugin2/
│ │ ├── data.{json|mp3|mp4}
│ │ ├── script.js
│ │ ├── plugin.js
│ │ └── view.xml
│ └── ...
└── manifest.json
```

- **`/script1`**: Contains all the files to document a custom script.
- Each script has a `script.js` and `view.xml` file that define the logic and UI of the script.
- **`/script.js`**: Contains the actual custom script `javascript` file that can be embedded in the Label Studio code editor.
- **`/view.xml`**: Stores an example of a `<View>` that will work along the script.
- **`/data.{json|mp3|mp4}`**: Stores an example of the data that can be used along with the script.
- **`manifest.json`**: This file lists the scripts, their metadata (title, description, etc.), and their paths for easy integration with Label Studio.
- **`/plugin1`**: Contains all the files to document a plugin.
- Each plugin has `plugin.js`, `view.xml`, and `data.json` files that define the logic, UI, and data of the plugin.
- **`/plugin.js`**: Contains the actual `javascript` plugin file that can be embedded in the Label Studio code editor.
- **`/view.xml`**: Stores an example of a `<View>` that will work along the plugin.
- **`/data.{json|mp3|mp4}`**: Stores an example of the data that can be used along with the plugin.
- **`manifest.json`**: This file lists the plugins, their metadata (title, description, etc.), and their paths for easy integration with Label Studio.

## Usage

After your script gets merged you will be able to find it in your project's **Labeling Interface**
After your plugin gets merged you will be able to find it in your project's **Labeling Interface**

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

## Contributing

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

1. **Create a new branch** for your feature or bugfix.
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.
3. **Register the script** in the `manifest.json` adding the following information:
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.
3. **Register the plugin** in the `manifest.json` adding the following information:
```json
[
{
"title": "Your script title",
"description": "Your script description",
"path": "exact_name_of_the_script_folder", // `script1` as per the File Structure example
"private": false // whether you want to hide it in the "Insert Script" dropdown in the Configurator code tab
"title": "Your plugin title",
"description": "Your plugin description",
"path": "exact-name-of-the-plugin-folder", // `plugin1` as per the File Structure example
"private": false // whether you want to hide it in the "Insert Plugin" dropdown in the Configurator code tab
}
]
```
Expand Down
10 changes: 0 additions & 10 deletions custom-scripts/bulk-labeling/data.json

This file was deleted.

27 changes: 0 additions & 27 deletions custom-scripts/bulk-labeling/script.js

This file was deleted.

5 changes: 0 additions & 5 deletions custom-scripts/count-words-in-textarea/data.json

This file was deleted.

22 changes: 0 additions & 22 deletions custom-scripts/count-words-in-textarea/script.js

This file was deleted.

5 changes: 0 additions & 5 deletions custom-scripts/different-images-per-label/data.json

This file was deleted.

48 changes: 0 additions & 48 deletions custom-scripts/different-images-per-label/script.js

This file was deleted.

103 changes: 0 additions & 103 deletions custom-scripts/llm-backend/script.js

This file was deleted.

5 changes: 0 additions & 5 deletions custom-scripts/markdown-to-html/data.json

This file was deleted.

Loading