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

Built-in content.list plugin #40

Closed
traut opened this issue Jan 14, 2024 · 0 comments
Closed

Built-in content.list plugin #40

traut opened this issue Jan 14, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@traut
Copy link
Member

traut commented Jan 14, 2024

Design

content.list plugin is a part of the fabric binary.

Specification

  • the plugin has no configuration options
  • API interface:
    • item_template -- a required string attribute. Defines a template string to be used for rendering a list item.

Behavior

The item_template template is applied to every object in query_result list.

For example,

content list "foo" {
  item_template = "* {{ event_type }}: {{ name }}": 
}

for query_result value

[
  {
    "event_type": "endpoint",
    "name": "Event Name 1"
  },
  {
    "event_type": "firewall",
    "name": "Event Name 2"
  }
]

will produce:

* endpoint: Event Name 1
* firewall: Event Name 2

It is enough to use "1. " at the start of the line (and render every line with "1. ") to get a proper ordered list, according to GitHub Markdown docs.

Deliverables

  • new built-in content.list plugin
  • the unit tests for the plugin
@traut traut added enhancement New feature or request plugins labels Jan 14, 2024
@traut traut added this to the v0.2 milestone Jan 14, 2024
@dobarx dobarx self-assigned this Jan 17, 2024
@traut traut closed this as completed Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants