Skip to content

Template functions inside README file #278

@ruflin

Description

@ruflin

Today the README.md file is a pure markdown file. All the data has to be added manually to it. As can be seen in #276 also the fields.yml are part of it to document the fields. My idea here is that allowing to use some templates / functions inside the README. These are executed during the build stage, so static files are served.

An example could look as following:

Below are the described fields:

{{fields dataset=nginx.access}}

The above would create the table for the nginx.access dataset with all the fields inside. The template code is just an example.

Which template language we should use here? Golang templates would be easy to use as the language already comes with it but it is specific to Golang. That the build process is written in Golang is an implementation detail. I would rather use something generic like moustache or handlebars. In our pipelines and config files we already use handlebars, so this would be the most obvious one. We should only use 1 template language in all our package files to keep the mental overhead for package creators low.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions