Add a way to add comments and TOML sections to config files
Comments can make config files more user-friendly by giving hints about possible values and where more info can be found. When config files get large, sections are useful to break it up so that things are easier to find.
Thanks for making this, confy made my life much much easier today.
So, as far as I see, this crate uses the default toml implementation for rust: The toml crate. The toml crate is toml compliant, thus you can simply use comments in your config files:
# this is a comment
foo = "bar"
Right? Or am I missing something?
I am not an expert of the toml crate. But like @matthiasbeyer said, you can add comments manually, however I think that you cannot write a configuration with comments. I have never seen a way to manage comments in a config file programmatically.
So, as far as I see, this crate uses the default toml implementation for rust: The
tomlcrate. Thetomlcrate is toml compliant, thus you can simply use comments in your config files:# this is a comment foo = "bar"Right? Or am I missing something?
I should have been more specific. I want comments to be generated when the config file is created as most configuration files come pre-commented for clarity:
# make sxhkd reload its configuration files:
super + Escape
pkill -USR1 -x sxhkd
#
# bspwm hotkeys
#
# quit/restart bspwm
super + alt + {q,r}
bspc {quit,wm -r}
Cargo.toml has a note: # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
On 15-02-2021 10:42:49, Spencer Burris wrote:
Cargo.tomlhas a note:# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
I'd say that's because Cargo.toml is not generated from a struct, but simply copied
from a template.