Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sainak committed Apr 12, 2024
1 parent c41b958 commit 00b3d78
Show file tree
Hide file tree
Showing 5 changed files with 151 additions and 41 deletions.
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ werkzeug = "==2.3.8"
[docs]
furo = "==2023.9.10"
sphinx = "==7.2.6"
myst-parser = "==2.0.0"

[requires]
python_version = "3.11"
94 changes: 92 additions & 2 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = []
extensions = ["myst_parser"]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]
Expand Down
57 changes: 57 additions & 0 deletions docs/pluggable-apps/configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Pluggable Apps


## Overview

Care supports plugins that can be used to extend its functionality. Plugins are basically django apps that are defined in the `plug_config.py`.
These plugins can be automatically loaded during docker image build or run time, however its recommended to include them during docker image build time.
The default care image does not include any plugins, but you can create your own plugin config by overriding the `plug_config.py` file.


example `plug_config.py` file:

```python

from plugs.manager import PlugManager
from plugs.plug import Plug

my_plugin = Plug(
name="my_plugin",
package_name="git+https://github.com/octo/my_plugin.git",
version="@v1.0.0",
configs={
"SERVICE_API_KEY": "my_api_key",
"SERVICE_SECRET_KEY": "my_secret_key",
"VALUE_1_MAX": 10,
},
)

plugs = [my_plugin]

manager = PlugManager(plugs)
```

## Plugin config variables

Each plugin will define their own config variables with some defaults, they can also pick the values from the environment variables if required.
The order of precedence is as follows:

- Environment variables
- Configs defined in the `plug_config.py`
- Default values defined in the plugin


## Development

To get started with developing a plugin, use [care-plugin-cookiecutter](https://github.com/coronasafe/care-plugin-cookiecutter)
The plugin follows the structure of a typical django app where you can define your models, views, urls, etc. in the plugin folder.
The plugin manager will automatically load the required configurations and plugin urls under `/api/plugin-name/`.

To develop the plugins locally you can install the plugin in the editable mode using `pip install -e /path/to/plugin`.

If you need to inherit the components from the core app, you can install care in editable mode in the plugin using `pip install -e /path/to/care`.


## Available Plugins

- [Care Scribe](https://github.com/coronasafe/care_scribe): Care Scribe is a plugin that provides autofill functionality for the care consultation forms.
38 changes: 0 additions & 38 deletions docs/pluggable-apps/configuration.rst

This file was deleted.

0 comments on commit 00b3d78

Please sign in to comment.