README: add plugins documentation

This commit is contained in:
2024-08-10 23:34:13 -07:00
parent eb2e17fe2d
commit 673e585cda

View File

@@ -81,6 +81,7 @@ Cryptocurrencies & blockchain metadata are unified with legacy finance to create
- Private: all of your accounts are under your control; not a 3rd party
- Secure: all financial activity is managed within a Docker container
- [Developer-friendly environment that keeps you in the zone](#image-dev-tools)
- [Plugins](#plugins) support for maximum extensibility
- See the [Development](#development) section for details
### Screenshots
@@ -476,6 +477,15 @@ The bind-mount is used exclusively for non-essential file sharing (custom script
- Example: `DOCKER_FINANCE_CLIENT_SHARED=/mnt/share.d`
> DOCKER_FINANCE_CLIENT_PLUGINS
Client (host) path for the client/container shared *custom* plugins.
The bind-mount is used exclusively for user-added plugins not in the repository.
- Example: `DOCKER_FINANCE_CLIENT_PLUGINS=/home/${USER}/Development/dfi_custom-plugins`
> DOCKER_FINANCE_CONTAINER_CMD
The container's `finance` command (useful for experimental implementations).
@@ -524,6 +534,15 @@ The container's `share.d` path, bind-mounted to client's (host's) `share.d` path
- Example: `DOCKER_FINANCE_CONTAINER_FLOW=/home/${USER}/share.d`
> DOCKER_FINANCE_CONTAINER_PLUGINS
The client's custom plugin path (as viewed from the container).
This path is bind-mounted to the client's (host's) `${DOCKER_FINANCE_CLIENT_PLUGINS}/container` path.
- Example: `DOCKER_FINANCE_CONTAINER_PLUGINS=/home/${USER}/plugins`
> DOCKER_FINANCE_CPUS
Docker daemon/container setting: number of CPUs to use.
@@ -870,6 +889,27 @@ You'll greatly benefit from building the [`dev-tools` image](#image-dev-tools),
Additionally, when developing with the [`docker-finance` image](#image-docker-finance), please test your work with mockups as described in [Environment Generation](#environment-generation) and [Flow Layout](#flow-layout).
> Note: mockup CSVs will *intentionally* have multiple years within in a `1-in/year` directory in order to test for year parsing.
#### Plugins
Plugins allow you to use `docker-finance` public APIs, libraries and environment (client and/or container) to meet your unique needs. These plugins are categorical; as in, there are client-side ("custom") plugins and repository ("repo") plugins. Additionally, there are subcategories such as `docker`, `finance` and `root` (respective to their modules).
Client-side custom plugins allow you to drop-in any code that you write and keep them locally. Repository plugins are plugins that remain within the repository and will require a pull request for any changes to be made. Client-side custom plugins can be used for either client or container modules (see directory layout).
Upon client `gen`, a client-side directory layout is generated. This layout consists of:
- `${DOCKER_FINANCE_CLIENT_PLUGINS}/client/docker`
- Custom plugins that function only client-side (`lib_docker`)
- `${DOCKER_FINANCE_CLIENT_PLUGINS}/container/{finance,root}`
- Custom plugins that function only container-side (`lib_finance`, `root`)
**WARNING: don't change the parent client-side directory layout** (although, you can add subdirectories):
- e.g., `${DOCKER_FINANCE_CLIENT_PLUGINS}/container/finance/my_experimental_plugins/{file1.ext,file2.ext}`
This client-side "custom" layout somewhat mirrors the repository's plugins layout (see [`client/plugins`](client/plugins) and [`container/plugins`](container/plugins)).
For more information, see the example plugins and help usage of each module, e.g.; `plugins help` or `help()`.
> Note: for custom plugins within directory `docker` and `finance` that utilize the shell, any language can be used so long as the file is executable, reads the shell environment and can initiailize their respective libraries (`lib_docker`, `lib_finance`).
#### Pull Request
The following assumes that the command `dev-tools` has been properly aliased, per `docker-finance help`.