Generate configuration templates
mainConfique can automatically generate configuration templates in various formats. These templates include field descriptions (from doc comments), default values, and environment variable information. This allows you to provide users with a starting configuration file without duplicating documentation.
Templates can be generated using the following pattern for supported formats:
- TOML:
toml::template::<Conf>() - YAML:
yaml::template::<Conf>() - JSON5:
json5::template::<Conf>()
// Example of what a generated TOML template might look like:
// # Port to listen on.
// #
// # Can also be specified via
// # environment variable `PORT`.
// #
// # Default value: 8080
// #port = 8080