Skip to content

Commit abdfc90

Browse files
authored
fix(docs): Fix documentation structure and content (#21)
1 parent 9747394 commit abdfc90

File tree

10 files changed

+182
-99
lines changed

10 files changed

+182
-99
lines changed

.makim.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,12 @@ groups:
2525
build:
2626
help: Build documentation
2727
run: |
28-
mkdocs build --config-file docs/mkdocs.yaml
28+
mkdocs build --config-file mkdocs.yaml
2929
3030
preview:
3131
help: Preview documentation page locally
32-
dependencies:
33-
- task: docs.build
3432
run: |
35-
mkdocs build --config-file docs/mkdocs.yaml
33+
mkdocs serve --watch docs --config-file mkdocs.yaml
3634
3735
tests:
3836
env:

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ for version `1.0`.
118118

119119
## Roadmap
120120

121-
- Integration with Ansible Vault for encryption.
122121
- Detailed spec and content management functionalities.
123122
- Enhancements in versioning and group management.
124123
- Integration with makim and sugar.

docs/api/references.md

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

docs/api/references.rst

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

docs/images/logo-big.png

127 KB
Loading

docs/images/logo.png

-7.98 KB
Loading

docs/index.md

Lines changed: 126 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,131 @@
1-
![LOGO](/images/logo.png)
2-
31
# Envers
42

5-
Envers is a tool for handling environment files (e.g. .env) for multiple kind of
6-
environments with versioning
7-
8-
- License: BSD 3 Clause
9-
- Documentation: https://envers.github.io
3+
`Envers` is a command-line tool (CLI) designed to manage and version environment
4+
variables for different deployment stages such as staging, development, and
5+
production. It provides a secure and organized way to handle
6+
environment-specific configurations.
107

118
## Features
129

13-
- The security of our code: Bandit is a powerful tool that we use in our Python
14-
project to ensure its security. This tool analyzes the code and detects
15-
potential vulnerabilities. Some of the key features of Bandit are its ease of
16-
use, its ability to integrate with other tools, and its support for multiple
17-
Python versions. If you want to know about bandit you can check its
18-
[documentation](https://bandit.readthedocs.io/en/latest/).
19-
20-
- Finds unused code: [Vulture](https://github.com/jendrikseipp/vulture) is
21-
useful for cleaning up and finding errors in large code bases in Python.
22-
23-
- Complexity of functions and modules: We use
24-
[McCabe](https://github.com/PyCQA/mccabe) to identify the complexity in our
25-
Python code that may be difficult to maintain or understand. By identifying
26-
complex code at the outset, we as developers can refactor it to make it easier
27-
to maintain and understand. In summary, McCabe helps us to improve the quality
28-
of our code and make it easier to maintain. If you would like to learn more
29-
about McCabe and code complexity, you can visit
30-
[McCabe - Code Complexity Checker](https://here-be-pythons.readthedocs.io/en/latest/python/mccabe.html).
31-
This tool is included with [Flake8](https://flake8.pycqa.org/en/latest/).
32-
33-
- TODO
34-
35-
## Credits
36-
37-
This package was created with Cookieninja and the
38-
[osl-incubator/scicookie](https://github.com/osl-incubator/scicookie) project
39-
template.
10+
- Encrypt environment variables: Creates encrypted files that store environment
11+
variables that can be safely stored in a git repository
12+
- Group-Based Configurations: Allows defining variables for different
13+
groups/profiles like prod, dev, etc.
14+
- File-Based Variable Definitions: Supports multiple environment files (.env)
15+
with specific variables for each file.
16+
- CLI-Driven: Provide CLI commands that helps to create drafts for environment
17+
variables and deploy it to encrypted files
18+
- Spec Management: Each release has a defined spec that applies to all
19+
groups/profiles within that release.
20+
- Environment File Generation: Enables generating .env files for specific
21+
versions and groups/profiles using commands.
22+
23+
## Installation
24+
25+
TBD
26+
27+
## Usage
28+
29+
Below are the initial subcommands for `envers`:
30+
31+
- `envers init`: Initialize the `envers` environment.
32+
- `envers deploy <spec version number>`: Deploy a specific version from the spec
33+
file.
34+
- `envers draft <spec version number>`: Create a new version draft in the spec
35+
file. Some variants of this command:
36+
- `envers draft <spec version number> --from <previous spec version number>`
37+
- `envers draft <spec version number> --from-env .env`
38+
- `envers profile-set --profile <profile_name> --spec <version_number>`: Add new
39+
content.
40+
- `envers profile load --profile prod --spec <spec version>`: Load a specific
41+
environment profile to files
42+
43+
`envers init` creates the spec file at `.envers/.specs.yaml`.
44+
45+
`envers deploy` creates the file `.envers/.data.lock`. This file is
46+
auto-generated by `envers` command, and it is encrypted.
47+
48+
The initial version of `./.envers/.specs.yaml` would look like this:
49+
50+
```yaml
51+
version: 0.1 # the envers spec version
52+
releases:
53+
```
54+
55+
As you can see, it doesn't have too much information. If you want to draft a new
56+
version, you can run the following command:
57+
58+
```bash
59+
$ envers draft 1.0
60+
```
61+
62+
After this command, the `.envers/specs.yaml` file should look like this:
63+
64+
```yaml
65+
version: 0.1 # the spec version
66+
releases:
67+
# placeholder: the version for the environment variables.
68+
# if the status is draft, feel free to change the version number
69+
1.0:
70+
# status attribute is handled by command line, don't change it manually
71+
status: draft # options are: draft, cancelled, deployed
72+
# placeholder: update help with the real help text
73+
help:
74+
# placeholder: a list of available profiles (groups) for this version.
75+
# at least one profile is required for the deploying
76+
profiles:
77+
- base
78+
# define the spec for that version, this spec should be used for all
79+
# profiles (groups) inside this version
80+
spec:
81+
# define the env file or any other kind of environment file to be used,
82+
# for now it just has support for .env files
83+
files:
84+
# placeholder: change `.env` to the correct dotenv file relative path
85+
.env:
86+
type: dotenv # default
87+
# `vars` is a dictionary for the environment variables
88+
# this defines the variables and some metadata, but not the real
89+
# value, because it is just the definition of the spec.
90+
vars:
91+
# placeholder: ENV is just a variable name, replace it by your real
92+
# environment variable
93+
ENV:
94+
type: string # options are: string, int, bool, path
95+
default: dev # in the case that the variable is not defined
96+
```
97+
98+
Now, you can deploy your first version of environment variables:
99+
100+
```bash
101+
$ envers deploy 1.0
102+
```
103+
104+
When a version is deployed, it creates automatically all the new spec into the
105+
`.envers/data.lock`.
106+
107+
All the variables for the each profile and spec version is stored into
108+
`.envers/data.lock`, and this file shouldn't be changed for any reason.
109+
110+
Finally, we can create the environment variables for the `base` profile:
111+
112+
```bash
113+
$ envers profile set --profile base --spec 1.0
114+
```
115+
116+
`envers` will ask you via prompt the value for each variable defined in the spec
117+
for version `1.0`.
118+
119+
## Roadmap
120+
121+
- Detailed spec and content management functionalities.
122+
- Enhancements in versioning and group management.
123+
- Integration with makim and sugar.
124+
125+
## Contributing
126+
127+
https://osl-incubator.github.io/envers
128+
129+
## License
130+
131+
BSD-Clause 3

docs/mkdocs.yaml renamed to mkdocs.yaml

Lines changed: 36 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
site_name: Envers
22
site_url: https://osl-incubator.github.io/envers
33
repo_url: https://github.com/osl-incubator/envers
4-
docs_dir: ./
5-
site_dir: ../build
4+
docs_dir: ./docs
5+
site_dir: ./build
66
# extra_css:
77
# - stylesheets/extra.css
88
# Page tree
@@ -11,7 +11,8 @@ nav:
1111
- Installation: installation.md
1212
- Changelog: changelog.md
1313
- Contributing: contributing.md
14-
- API: api/references.md
14+
# from gen-files
15+
- API: api/
1516
- Notebook page: example.ipynb
1617
theme:
1718
name: material
@@ -26,8 +27,8 @@ theme:
2627
- search.suggest
2728
icon:
2829
repo: fontawesome/brands/github
29-
logo: /images/logo.png
30-
favicon: /images/favicon.png
30+
logo: ./images/logo.png
31+
favicon: ./images/favicon.png
3132
palette:
3233
scheme: slate
3334
primary: white
@@ -36,10 +37,15 @@ theme:
3637
plugins:
3738
- search
3839
- macros
39-
# - autorefs
40+
- autorefs
4041
# - exclude:
4142
# glob:
4243
# - backends/template.md
44+
- gen-files:
45+
scripts:
46+
- scripts/gen_ref_nav.py
47+
- literate-nav:
48+
nav_file: SUMMARY.md
4349
- mkdocstrings:
4450
enable_inventory: true
4551
handlers:
@@ -49,52 +55,33 @@ plugins:
4955
import:
5056
- https://docs.python.org/3/objects.inv
5157
options:
58+
docstring_options:
59+
ignore_init_summary: true
60+
docstring_section_style: list
5261
docstring_style: numpy
53-
filters:
54-
- "!^Bounds"
55-
- "!^__class__"
56-
- "!^_filter_with_like"
57-
- "!^_find_backends"
58-
- "!^_key$"
59-
- "!^_literal_value_hash_key"
60-
- "!^_log"
61-
- "!^_nbytes"
62-
- "!^_safe_name$"
63-
- "!^_schema_from_csv"
64-
- "!^_to_geodataframe"
65-
- "!^_tuplize"
66-
- "!^ast_schema"
67-
- "!^backend_table_type"
68-
- "!^bounds$"
69-
- "!^column$"
70-
- "!^compiler$"
71-
- "!^context_class"
72-
- "!^database_class"
73-
- "!^do_connect"
74-
- "!^fetch_from_cursor"
75-
- "!^get_schema"
76-
- "!^largest$"
77-
- "!^reconnect"
78-
- "!^select_builder_class"
79-
- "!^select_class"
80-
- "!^table_class$"
81-
- "!^table_expr_class"
82-
- "!^translator_class"
83-
- "!^Options$"
84-
show_category_heading: true
62+
filters: ["!^_"]
63+
heading_level: 1
64+
inherited_members: true
65+
merge_init_into_class: true
66+
separate_signature: true
67+
# show_category_heading: true
68+
# show_modules: true
8569
show_root_full_path: false
8670
show_root_heading: true
87-
show_root_toc_entry: true
88-
show_source: false
89-
show_modules: true
71+
# show_root_toc_entry: true
72+
show_signature_annotations: true
73+
show_source: true
74+
show_symbol_type_heading: true
75+
show_symbol_type_toc: true
76+
signature_crossrefs: true
77+
summary: true
9078
- mkdocs-jupyter:
91-
execute: true
79+
execute: false
9280
ignore:
9381
- "*.py"
94-
# execute_ignore: "tutorial/*Geospatial*.ipynb"
82+
- ".ipynb_checkpoints/*"
9583
include_source: true
96-
theme: dark
97-
- literate-nav
84+
include_requirejs: true
9885
markdown_extensions:
9986
- admonition
10087
- attr_list
@@ -110,8 +97,10 @@ markdown_extensions:
11097
custom_icons:
11198
- docs/static/icons
11299
- pymdownx.details
113-
- pymdownx.highlight
114-
- pymdownx.inlinehilite
100+
- pymdownx.highlight:
101+
pygments_lang_class: true
102+
- pymdownx.inlinehilite:
103+
style_plain_text: python
115104
- pymdownx.magiclink:
116105
provider: github
117106
repo_url_shortener: true

poetry.lock

Lines changed: 16 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ mkdocs-jupyter = ">=0.24.1"
4646
mkdocs-literate-nav = ">=0.6.0"
4747
mkdocs-macros-plugin = ">=0.7.0,<1"
4848
mkdocs-material = ">=9.1.15"
49-
mkdocstrings = ">=0.21.2"
49+
mkdocstrings = {version=">=0.24.3", extras=["python"]}
50+
mkdocs-gen-files = ">=0.5.0"
5051
mkdocstrings-python = ">=1.1.2"
5152
makim ="1.16.0"
5253

0 commit comments

Comments
 (0)