Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 0 additions & 80 deletions docs/node/config/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,83 +77,3 @@ paths = (
}
)
```

## Tips & Tricks

### Use environment variables in your configuration {#node-config-envvars}

VILLASnode substitutes any environment variables in you JSON and libconfig configuration files.

To replace environment variables you must use the following syntax within any string value of your config: `${MYENV_VAR}`.

**Note:** Non-string values can currently not be substituted by environment variables!

#### Example

<!-- convert to JSON -->
```
nodes = {
file_node = {
uri = "${FILE_PATH}"
}
}
```

### Include other files into your configuration {#node-config-include}

VILLASnode can include other files into you configuration.
This allows you to better structure and reuse parts of your configuration (e.g. the node definitions).

File inclusion is handled via a special key in JSON objects named `@include`.
The value of this key must point to an existing file on your file system.

**Note:** libconfig supports inclusion of other files [out of the box via @include directives](http://hyperrealm.github.io/libconfig/libconfig_manual.html#Include-Directives). So this tip is mostly useful for JSON configuration files.

#### Example

```json title="params.json"
{
"gain": 1.45,
"t_dt": 50e-6
}
```

```json title="nodes.json"
{
"test_node": {
"type": "file",
"in": {
"signals": {
"count": 12,
"type": "float"
}
}
},
"signal_node": {
"signal": "random",
"in": {
"hooks": [
{
"type": "lua",
"script": "myscript.lua",
"@include": "params.json"
}
]
}
}
}
```

```json title="experiment1.json"
{
"nodes":{
"@include": "nodes.json"
},
"paths": [
{
"in": "signal_node",
"out": "test_node"
}
]
}
```