mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 15:03:28 +00:00
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:
parent
224c195208
commit
64f0f7a448
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user