https://github.com/anderseknert/tabler
Turn your data into tables, in Rego!
https://github.com/anderseknert/tabler
markdown open-policy-agent rego table-generator
Last synced: 7 months ago
JSON representation
Turn your data into tables, in Rego!
- Host: GitHub
- URL: https://github.com/anderseknert/tabler
- Owner: anderseknert
- Created: 2025-06-02T20:22:58.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2025-06-04T11:26:13.000Z (7 months ago)
- Last Synced: 2025-06-28T12:06:19.861Z (7 months ago)
- Topics: markdown, open-policy-agent, rego, table-generator
- Language: Open Policy Agent
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# tabler
Use tabler to generate tables from your data, in Rego.
One of my many projects using Rego for things Rego wasn't intended for.
If that's your thing too, enjoy!
## Usage
```rego
package p
import data.tabler
r := tabler.render(
[
["Category", "Rule", "Description"],
["Bugs", "inconsistent-args", "Inconsistently named function arguments"],
["Idiomatic", "boolean-assignment", "Prefer if over boolean assignment"],
["Imports", "pointless-import", "Importing own package is pointless"],
],
{"style": "rounded"},
)
```
```shell
opa eval -f raw -d . data.p.r
```
```text
╭─────────┬──────────────────┬───────────────────────────────────────╮
│Category │Rule │Description │
├─────────┼──────────────────┼───────────────────────────────────────┤
│Bugs │inconsistent-args │Inconsistently named function arguments│
├─────────┼──────────────────┼───────────────────────────────────────┤
│Idiomatic│boolean-assignment│Prefer if over boolean assignment │
├─────────┼──────────────────┼───────────────────────────────────────┤
│Imports │pointless-import │Importing own package is pointless │
╰─────────┴──────────────────┴───────────────────────────────────────╯
```
## Configuration
The generated table is configured via the passed `config` object. The `config` object accepts the following keys:
- `style`: The style of the table (border). Supported styles are `light`, `double` and `rounded`. Defaults to `light`.