Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zenitysec/sphinx-rego
Sphinx extension that automatically documents Open Policy Agent Rego policies
https://github.com/zenitysec/sphinx-rego
conftest documentation-tool opa open-policy-agent open-policy-agent-python rego sphinx
Last synced: 3 months ago
JSON representation
Sphinx extension that automatically documents Open Policy Agent Rego policies
- Host: GitHub
- URL: https://github.com/zenitysec/sphinx-rego
- Owner: zenitysec
- License: mit
- Created: 2021-04-19T13:08:29.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-18T10:15:05.000Z (over 1 year ago)
- Last Synced: 2024-07-25T05:36:59.789Z (4 months ago)
- Topics: conftest, documentation-tool, opa, open-policy-agent, open-policy-agent-python, rego, sphinx
- Language: Python
- Homepage: https://zenity.io
- Size: 97.7 KB
- Stars: 23
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-opa - Sphinx Rego - Sphinx extension that automatically documents Rego policies (Language and Platform Integrations / Python)
README
sphinx-rego
===============A sphinx extension that automatically documents Open Policy Agent Rego policies using the _rego_metadoc_ property.
Maintained by [Zenity](https://zenity.io).
# Example
See [example/](/example) dir for a documented usage example.
![Sphinx Docs](/example/assets/policy.small.png)
# Prerequisites
- Install [Open Policy Agent](https://www.openpolicyagent.org/docs/latest/#1-download-opa)
- Make sure the `opa` CLI is available# Installation:
Install with PIP
``` commandline
pip3 install sphinx-rego
```Add to Sphinx `conf.py`
``` python
extensions += ["sphinxrego.ext"]
```# Usage Example:
```
.. rego::
:policy: policies/**/*.rego
:norecursive:
:nocustom:
```# Arguments:
_policy_: glob pathname to search for .rego policies with _rego_metadoc_ property
_norecursive_: whether to use glob recursive option
_norecursive_: whether to include custom properties