Skip to content

Commit

Permalink
Docs: Update plugins and compose (#7263)
Browse files Browse the repository at this point in the history
* docs: Update docker compose dev setup

* docs: Fix example plugin date

Date must be iso formatted, otherwise exception is raised

* docs: Update plugin paths to new folder structure

* docs: fix typo, remove temporary containers afterwards
  • Loading branch information
p-fruck committed May 20, 2024
1 parent c540b12 commit 442bb73
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions docs/docs/develop/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ To setup a development environment using [docker](../start/docker.md), run the f

```bash
git clone https://github.com/inventree/InvenTree.git && cd InvenTree
docker compose run inventree-dev-server invoke install
docker compose run inventree-dev-server invoke setup-test --dev
docker compose up -d
docker compose --project-directory . -f contrib/container/dev-docker-compose.yml run --rm inventree-dev-server invoke install
docker compose --project-directory . -f contrib/container/dev-docker-compose.yml run --rm inventree-dev-server invoke setup-test --dev
docker compose --project-directory . -f contrib/container/dev-docker-compose.yml up -d
```

### Bare Metal
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/extend/how_to_plugin.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ class SampleActionPlugin(ActionMixin, InvenTreePlugin):
# metadata
AUTHOR = "Sample Author"
DESCRIPTION = "A very basic plugin with one mixin"
PUBLISH_DATE = "22.02.2222"
PUBLISH_DATE = "2222-02-22"
VERSION = "1.2.3" # We recommend semver and increase the major version with each new major release of InvenTree
WEBSITE = "https://example.com/"
LICENSE = "MIT" # use what you want - OSI approved is ♥
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/extend/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The InvenTree server code supports an extensible plugin architecture, allowing c
Plugins can be added from multiple sources:

- Plugins can be installed in InvenTrees venv via PIP (python package manager)
- Custom plugins should be placed in the directory `./src/backend/InvenTree/plugins`.
- Custom plugins should be placed in the directory `./data/plugins`.
- InvenTree built-in plugins are located in the directory `./src/backend/InvenTree/plugin/builtin`.

For further information, read more about [installing plugins](./plugins/install.md).
Expand Down
2 changes: 1 addition & 1 deletion docs/docs/extend/plugins/barcode.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ title: Barcode Mixin

InvenTree supports decoding of arbitrary barcode data via a **Barcode Plugin** interface. Barcode data POSTed to the `/api/barcode/` endpoint will be supplied to all loaded barcode plugins, and the first plugin to successfully interpret the barcode data will return a response to the client.

InvenTree can generate native QR codes to represent database objects (e.g. a single StockItem). This barcode can then be used to perform quick lookup of a stock item or location in the database. A client application (for example the InvenTree mobile app) scans a barcode, and sends the barcode data to the InvenTree server. The server then uses the **InvenTreeBarcodePlugin** (found at `/src/backend/InvenTree/plugins/barcode/inventree.py`) to decode the supplied barcode data.
InvenTree can generate native QR codes to represent database objects (e.g. a single StockItem). This barcode can then be used to perform quick lookup of a stock item or location in the database. A client application (for example the InvenTree mobile app) scans a barcode, and sends the barcode data to the InvenTree server. The server then uses the **InvenTreeBarcodePlugin** (found at `src/backend/InvenTree/plugin/builtin/barcodes/inventree_barcode.py`) to decode the supplied barcode data.

Any third-party barcodes can be decoded by writing a matching plugin to decode the barcode data. These plugins could then perform a server-side action or render a JSON response back to the client for further action.

Expand Down
4 changes: 2 additions & 2 deletions docs/docs/extend/plugins/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ Admin users can install plugins directly from the web interface, via the "Plugin

#### Local Directory

Custom plugins can be placed in the `src/InvenTree/plugins/` directory, where they will be automatically discovered. This can be useful for developing and testing plugins, but can prove more difficult in production (e.g. when using Docker).
Custom plugins can be placed in the `data/plugins/` directory, where they will be automatically discovered. This can be useful for developing and testing plugins, but can prove more difficult in production (e.g. when using Docker).

!!! info "Git Tracking"
The `src/backend/InvenTree/plugins/` directory is excluded from Git version tracking - any plugin files here will be hidden from Git
The `data/plugins/` directory is excluded from Git version tracking - any plugin files here will be hidden from Git

!!! warning "Not Recommended For Production"
Loading plugins via the local *plugins* directory is not recommended for production. If you cannot use PIP installation (above), specify a custom plugin directory (below) or use a [VCS](https://pip.pypa.io/en/stable/topics/vcs-support/) as a plugin install source.
Expand Down

0 comments on commit 442bb73

Please sign in to comment.