lib.trivial.importTOML: add example

Friend came to me with misunderstanding of how this function works.
After discussion we came to the conclusion having an example would have
prevented this.
This commit is contained in:
Samuel Shuert 2024-06-07 17:15:50 -04:00 committed by Silvan Mosberger
parent 224c195208
commit 64f0f7a448

View File

@ -642,6 +642,35 @@ in {
/**
Reads a TOML file.
# Examples
:::{.example}
## `lib.trivial.importTOML` usage example
example.toml
```toml
title = "TOML Example"
[hello]
world = "foo"
[hello.bar]
foobar = true
```
```nix
importTOML ./example.toml
=> {
title = "TOML Example";
hello = {
world = "foo";
bar = {
foobar = true;
};
};
}
```
:::
# Inputs