lib.trivial.importJSON: add example
Add parity with importTOML.
This commit is contained in:
parent
64f0f7a448
commit
cfc6c9b6e4
@ -623,6 +623,37 @@ in {
|
||||
/**
|
||||
Reads a JSON file.
|
||||
|
||||
# Examples
|
||||
:::{.example}
|
||||
## `lib.trivial.importJSON` usage example
|
||||
|
||||
example.json
|
||||
```json
|
||||
{
|
||||
"title": "Example JSON",
|
||||
"hello": {
|
||||
"world": "foo",
|
||||
"bar": {
|
||||
"foobar": true
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
```nix
|
||||
importJSON ./example.json
|
||||
=> {
|
||||
title = "Example JSON";
|
||||
hello = {
|
||||
world = "foo";
|
||||
bar = {
|
||||
foobar = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
:::
|
||||
|
||||
# Inputs
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user