Skip to content

Commit 565e25a

Browse files
committed
feat: LEAP-1683: Adapted structure and improved docs
1 parent 545ae1b commit 565e25a

File tree

37 files changed

+172
-1
lines changed

37 files changed

+172
-1
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
## Description
2+
3+
<!-- A brief description of what this PR accomplishes. Include any screenshots if helpful. -->
4+
5+
## Related Issues
6+
7+
<!-- If this PR fixes an issue, link it here (e.g. Fixes #123). -->
8+
9+
## Checklist
10+
11+
- [ ] I have tested the changes in the Label Studio Labeling Config.
12+
- [ ] I have added the `script.js` file.
13+
- [ ] I have added the `view.xml` file.
14+
- [ ] My code follows the guidelines stated in the README.md.
15+
16+
<!-- Thanks for contributing to Awesome Label Studio Configs! -->
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Validate Folder Structure
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
check-structure:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout Repository
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: 20
20+
21+
- name: Run Folder Structure Check
22+
run: node validate-structure.mjs

README.md

Lines changed: 72 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,72 @@
1-
# label-studio-custom-scripts
1+
# Label Studio Custom Scripts
2+
3+
4+
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+
6+
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.
7+
8+
## Official Documentation
9+
10+
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).
11+
12+
## File Structure
13+
14+
This repository follows a clear folder structure to organize the various custom scripts and configuration files:
15+
16+
```bash
17+
label-studio-custom-scripts/
18+
├── custom-scripts/
19+
│ ├── script1/
20+
│ │ ├── data.{json|mp3|mp4}
21+
│ │ ├── script.js
22+
│ │ └── view.xml
23+
│ ├── script2/
24+
│ │ ├── data.{json|mp3|mp4}
25+
│ │ ├── script.js
26+
│ │ └── view.xml
27+
│ └── ...
28+
└── manifest.json
29+
```
30+
31+
- **`/script1`**: Contains all the files to document a custom script.
32+
- Each script has a `script.js` and `view.xml` file that define the logic and UI of the script.
33+
- **`/script.js`**: Contains the actual custom script `javascript` file that can be embedded in the Label Studio code editor.
34+
- **`/view.xml`**: Stores an example of a `<View>` that will work along the script.
35+
- **`/data.{json|mp3|mp4}`**: Stores an example of the data that can be used along with the script.
36+
- **`manifest.json`**: This file lists the scripts, their metadata (title, description, etc.), and their paths for easy integration with Label Studio.
37+
38+
## Usage
39+
40+
After your script gets merged you will be able to find it in your project's **Labeling Interface**
41+
42+
![Labeling Interface](docs/labeling-interface.png)
43+
44+
## Contributing
45+
46+
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:
47+
48+
1. **Create a new branch** for your feature or bugfix.
49+
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.
50+
3. **Register the script** in the `manifest.json` adding the following information:
51+
```json
52+
[
53+
{
54+
"title": "Your script title",
55+
"description": "Your script description",
56+
"path": "exact_name_of_the_script_folder", // `script1` as per the File Structure example
57+
"private": false // whether you want to hide it in the "Insert Script" dropdown in the Configurator code tab
58+
}
59+
]
60+
```
61+
4. **Test your changes** to ensure everything works as expected.
62+
5. **Submit a pull request** explaining the changes you made.
63+
64+
Please make sure that your contributions follow the existing code style and structure.
65+
66+
## License
67+
68+
This software is licensed under the [Apache 2.0 LICENSE](/LICENSE) © [Heartex](https://www.heartex.com/). 2020-2025
69+
70+
---
71+
72+
If you have any questions or need assistance, feel free to reach out through issues or discussions. We look forward to your contributions!
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)