Skip to content

Commit 00b3d78

Browse files
committed
update docs
1 parent c41b958 commit 00b3d78

File tree

5 files changed

+151
-41
lines changed

5 files changed

+151
-41
lines changed

Pipfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ werkzeug = "==2.3.8"
7171
[docs]
7272
furo = "==2023.9.10"
7373
sphinx = "==7.2.6"
74+
myst-parser = "==2.0.0"
7475

7576
[requires]
7677
python_version = "3.11"

Pipfile.lock

Lines changed: 92 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
# Add any Sphinx extension module names here, as strings. They can be
3232
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
3333
# ones.
34-
extensions = []
34+
extensions = ["myst_parser"]
3535

3636
# Add any paths that contain templates here, relative to this directory.
3737
templates_path = ["_templates"]

docs/pluggable-apps/configuration.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Pluggable Apps
2+
3+
4+
## Overview
5+
6+
Care supports plugins that can be used to extend its functionality. Plugins are basically django apps that are defined in the `plug_config.py`.
7+
These plugins can be automatically loaded during docker image build or run time, however its recommended to include them during docker image build time.
8+
The default care image does not include any plugins, but you can create your own plugin config by overriding the `plug_config.py` file.
9+
10+
11+
example `plug_config.py` file:
12+
13+
```python
14+
15+
from plugs.manager import PlugManager
16+
from plugs.plug import Plug
17+
18+
my_plugin = Plug(
19+
name="my_plugin",
20+
package_name="git+https://github.com/octo/my_plugin.git",
21+
version="@v1.0.0",
22+
configs={
23+
"SERVICE_API_KEY": "my_api_key",
24+
"SERVICE_SECRET_KEY": "my_secret_key",
25+
"VALUE_1_MAX": 10,
26+
},
27+
)
28+
29+
plugs = [my_plugin]
30+
31+
manager = PlugManager(plugs)
32+
```
33+
34+
## Plugin config variables
35+
36+
Each plugin will define their own config variables with some defaults, they can also pick the values from the environment variables if required.
37+
The order of precedence is as follows:
38+
39+
- Environment variables
40+
- Configs defined in the `plug_config.py`
41+
- Default values defined in the plugin
42+
43+
44+
## Development
45+
46+
To get started with developing a plugin, use [care-plugin-cookiecutter](https://github.com/coronasafe/care-plugin-cookiecutter)
47+
The plugin follows the structure of a typical django app where you can define your models, views, urls, etc. in the plugin folder.
48+
The plugin manager will automatically load the required configurations and plugin urls under `/api/plugin-name/`.
49+
50+
To develop the plugins locally you can install the plugin in the editable mode using `pip install -e /path/to/plugin`.
51+
52+
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`.
53+
54+
55+
## Available Plugins
56+
57+
- [Care Scribe](https://github.com/coronasafe/care_scribe): Care Scribe is a plugin that provides autofill functionality for the care consultation forms.

docs/pluggable-apps/configuration.rst

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)