Skip to content

Commit

Permalink
Merge pull request #1186 from lcarva/EC-109-landing
Browse files Browse the repository at this point in the history
Make rego landing page list functions
  • Loading branch information
lcarva authored Dec 5, 2023
2 parents 0f17829 + 05ddac5 commit 4e9d9c5
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
6 changes: 0 additions & 6 deletions docs/modules/ROOT/pages/rego.adoc

This file was deleted.

16 changes: 16 additions & 0 deletions docs/modules/ROOT/pages/rego_builtins.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
= ec rego functions reference documentation

The EC CLI provides custom rego builtin functions in addition to the
https://www.openpolicyagent.org/docs/latest/policy-reference/#built-in-functions[default ones].

Below is a summary of each function added by the EC CLI. Click on their names to view additional
information.

[cols="1,3"]
|===
{{#each reference}}
|xref:{{ path }}[{{ name }}]
|{{ description }}

{{/each}}
|===
2 changes: 1 addition & 1 deletion docs/modules/ROOT/partials/rego_nav.adoc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
* xref:rego.adoc[Rego Reference]
* xref:rego_builtins.adoc[Rego Reference]
{{#each reference}}
** xref:{{ path }}[{{ name }}]
{{/each}}
5 changes: 5 additions & 0 deletions rego-antora-extension/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,16 @@ module.exports.register = function () {
regoDocs.push({
path: basename,
name: data.name,
description: data.description,
});
});

const nav = content.files.find(f => f.path.endsWith('rego_nav.adoc'));
const navTemplate = Handlebars.compile(nav.contents.toString());
nav.contents = Buffer.from(navTemplate({ reference: regoDocs }));

const landing = content.files.find(f => f.path.endsWith('rego_builtins.adoc'));
const landingTemplate = Handlebars.compile(landing.contents.toString());
landing.contents = Buffer.from(landingTemplate({ reference: regoDocs }));
})
}

0 comments on commit 4e9d9c5

Please sign in to comment.