Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Documentation command #1009

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

xNok
Copy link

@xNok xNok commented Sep 30, 2024

I found myself wanting to generate reference documentation for my policies, and I figured it would be nice if this was a built-in feature of conftest.

While the way of structuring the documentation can be opinionated, I think using the FlatAnnotationsRefSet is a safe bet, as OPA's core does all the heavy lifting of organizing annotations and rules.

My initial attempt was to combine FlatAnnotationsRefSet and Go-template and offer the least opinionated approach to documentation format that can be easily overridden. However, I had some trouble properly formatting titles (H1, H2, H3, etc...) and had to introduce some custom logic to handle it. (As a side note this could potentially be handles by adding template function libraries such as sprig)

Signed-off-by: Alexandre Couedelo <[email protected]>
I am testing different way to generate the doc. Having the compiler object is much easier than the annotation set only

Signed-off-by: Alexandre Couedelo <[email protected]>
Signed-off-by: Alexandre Couedelo <[email protected]>
Signed-off-by: Alexandre Couedelo <[email protected]>
Signed-off-by: Alexandre Couedelo <[email protected]>
Signed-off-by: Alexandre Couedelo <[email protected]>
Signed-off-by: Alexandre Couedelo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant