vectordotdev / vrl

Vector Remap Language
Mozilla Public License 2.0
115 stars 52 forks source link

Auto-generate VRL function documentation #280

Open fuchsnj opened 1 year ago

fuchsnj commented 1 year ago

Problem

Before the VRL repo was split from Vector, VRL function documentation was manually added for each change in CUE docs. Now since the repo is split, there is currently no way to add / update documentation with each PR. Even before, it was easy for documentation to become out of date since it's manually updated and nothing is checking it for accuracy.

Proposal

The source of documentation will live wherever VRL functions are defined. (The VRL repo for stdlib functions, or other repos for user added functions, such as Vector specific VRL functions). This will be auto-generated directly from the code (function name, parameters, examples, .etc) and supplemented by annotations were needed. This will be roughly similar to Vector's config schema

The VRL repo will contain a tool that can generate a computer-readable intermediate format of the function documentation in JSON. This allows end-users of VRL to generate documentation from the intermediate format.

For example:

pront commented 9 months ago

Notes from our offline discussion: