diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index a893f23..0000000 Binary files a/.DS_Store and /dev/null differ diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..fc33349 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,16 @@ +## Description + + + +## Related Issues + + + +## Checklist + +- [ ] I have tested the changes in the Label Studio Labeling Config. +- [ ] I have added the `plugin.js` file. +- [ ] I have added the `view.xml` file. +- [ ] My code follows the guidelines stated in the README.md. + + diff --git a/.github/workflows/validate-plugins.yml b/.github/workflows/validate-plugins.yml new file mode 100644 index 0000000..a122825 --- /dev/null +++ b/.github/workflows/validate-plugins.yml @@ -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 . diff --git a/README.md b/README.md index cf60134..87c60f2 100644 --- a/README.md +++ b/README.md @@ -1 +1,79 @@ -# label-studio-custom-scripts \ No newline at end of file +![Label Studio Plugins](docs/banner.png) + +# Label Studio Plugins + +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. + +> **Note**: Plugins are an `Enterprise` feature and require a [Label Studio Enterprise](https://humansignal.com/pricing/) subscription to use. + +## Official Documentation + +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 plugins and configuration files: + +```bash +label-studio-plugins/ +├── src/ +│ ├── plugin1/ +│ │ ├── data.{json|mp3|mp4} +│ │ ├── plugin.js +│ │ └── view.xml +│ ├── plugin2/ +│ │ ├── data.{json|mp3|mp4} +│ │ ├── plugin.js +│ │ └── view.xml +│ └── ... +└── manifest.json +``` + +- **`/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 `` 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 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 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 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 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 + } + ] + ``` +4. **Test your changes** to ensure everything works as expected. +5. **Submit a pull request** explaining the changes you made. + +Please make sure that your contributions follow the existing code style and structure. + +## License + +This software is licensed under the [Apache 2.0 LICENSE](/LICENSE) © [Heartex](https://www.heartex.com/). 2020-2025 + +--- + +If you have any questions or need assistance, feel free to reach out through issues or discussions. We look forward to your contributions! diff --git a/bulk_labeling/html.txt b/bulk_labeling/html.txt deleted file mode 100644 index 6eb45dd..0000000 --- a/bulk_labeling/html.txt +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - diff --git a/bulk_labeling/js.txt b/bulk_labeling/js.txt deleted file mode 100644 index 3164174..0000000 --- a/bulk_labeling/js.txt +++ /dev/null @@ -1,18 +0,0 @@ -LSI.on('entityCreate', region => { - if (window.BULK_REGIONS) return; - window.BULK_REGIONS = true; - setTimeout(() => window.BULK_REGIONS = false, 1000); - console.log('matches', region.object._value.matchAll(region.text)); - setTimeout(() => { - region.object._value.matchAll(new RegExp(region.text, "gi")).forEach(m => { - if (m.index === region.startOffset) return; - Htx.annotationStore.selected.createResult( - { text: region.text, start: "/span[1]/text()[1]", startOffset: m.index, end: "/span[1]/text()[1]", endOffset: m.index + region.text.length }, - { labels: [...region.labeling.value.labels] }, - region.labeling.from_name, - region.object, - ) - }) - Htx.annotationStore.selected.updateObjects() - }, 100); -}); diff --git a/count_words_in_textarea/.DS_Store b/count_words_in_textarea/.DS_Store deleted file mode 100644 index 5008ddf..0000000 Binary files a/count_words_in_textarea/.DS_Store and /dev/null differ diff --git a/count_words_in_textarea/html.txt b/count_words_in_textarea/html.txt deleted file mode 100644 index 29dc91c..0000000 --- a/count_words_in_textarea/html.txt +++ /dev/null @@ -1,22 +0,0 @@ - -
- - - - - - - - - - - - - - -