Skip to content

Latest commit

 

History

History
32 lines (24 loc) · 825 Bytes

README.md

File metadata and controls

32 lines (24 loc) · 825 Bytes

sphinx-rego Example

We are two .rego policies, each with their own metadoc properties. Here is one for example:

package rules.aws.tag

__rego__metadoc__ := {
    "id": "PL203",
    "title": "Resources tags",
    "description": "All AWS resources must have tags",
    "custom": {
        "severity": "High"
    }
}

Sphinx-rego extension reads these properties with a simple policy.rst command. Notice that we give a glob pathname to the _:policy: argument, so our two policy files could be in any subdirectory of policy/.

Policy Documentation
=======================================

.. rego::
   :policy: ../policy/**/*.rego

The extension generates documentation accordingly:

Sphinx Docs