The `render` command is used to interop with third-party tools that do not use a supported config file format.

Consider a fictional tool named `acme`. This tool reads configuration files in Pythons `configparser` format (similar to ini).

<!-- {{{      -->
<!-- from pathlib import Path as P          -->
<!-- code = P('acme').read_text()           -->
<!-- }}}      -->

**acme**
```python
{{code}}
```

A typical configuration file looks something like this:
<!-- {{{      -->
<!-- from pathlib import Path as P          -->
<!-- code = P('ACME-solver.ini').read_text()           -->
<!-- }}}      -->

```ini
{{code}}
```

and we run it like this
<!-- {{{      -->
<!-- from subprocess import check_output as run          -->
<!-- run('rm -r scratch',shell=True)           -->
<!-- run('mkdir scratch; cd scratch; cp ../acme ../ACME-solver.ini .',shell=True)           -->
<!-- acme_output = run('cd scratch; python acme ACME-solver.ini',shell=True).decode()           -->
<!-- ls_output = run('cd scratch; ls',shell=True).decode()           -->
<!-- }}}      -->
```bash
$ python acme ACME-solver.ini
{{acme_output}}
$ ls
{{ls_output}}
```
We would like to powerup our `acme` config file to add unit suport. We start by writing a powerconf configuration
file. We are free to structure the configuration however we want, config parameters can be given as quantities with units,
and we can use expressions that calculate the value of some paraemters based on the value of others.
<!-- {{{      -->
<!-- code = P('POWERCONFIG.yml').read_text().split("#")[0]           -->
<!-- }}}      -->

**POWERCONFIG.yml**
```yaml
{{code}}
```

We can test that this configuration works with the `print-instances` command:
<!-- {{{      -->
<!-- output = "simulation"+run('uv run powerconf print-instances POWERCONFIG.yml',shell=True).decode().split('simulation')[2]           -->
<!-- }}}      -->

```bash
$ powerconf print-instances
{{output}}
```

Next, we add a section to our configuration file for the acme tool. We add a parameter for every value
we want to inject into our acme config, and we compute the value that will be injected using expressions.
The purpose of this section is to unit convert all parameters to the unit expected by the acme tool and
strip the units.
<!-- {{{      -->
<!-- code = P('POWERCONFIG.yml').read_text()                         -->
<!-- }}}      -->

**POWERCONFIG.yml**
```yaml
{{code}}
```
Nex, we write an acme configuration _template_. The template is a mustache template, `powerconf render`
will render this file using mustache with the powerconf configuration instance as a context. To inject
the parameters, we just reference the keys under the "acme" node.
<!-- {{{      -->
<!-- code = P('ACME-solver.ini.template').read_text()                         -->
<!-- }}}      -->

**ACME-solver.ini.template**
```yaml
{{code}}
```

And finally, we can render an ACME configuration file
<!-- {{{      -->
<!-- run('mkdir scratch; cd scratch; cp ../POWERCONFIG.yml ../ACME-solver.ini.template .',shell=True)           -->
<!-- powerconf_output = run('cd scratch; uv run powerconf render POWERCONFIG.yml ACME-solver.ini.template  ACME-solver.ini.rendered',shell=True).decode()           -->
<!-- ls_output = run('cd scratch; ls',shell=True).decode()           -->
<!-- }}}      -->
```bash
$ powerconf render POWERCONFIG.yml ACME-solver.ini.template ACME-solver.ini.rendered
{{powerconf_output}}
$ ls
{{ls_output}}
```
The contents of `ACME-solver.ini.rendered` will be

<!-- {{{      -->
<!-- code = P('scratch/ACME-simulation.ini.rendered').read_text()           -->
<!-- }}}      -->
```ini
{{code}}
```
Running `acme`...
<!-- {{{      -->
<!-- acme_output = run('cd scratch; python acme ACME-solver.ini.rendered',shell=True).decode()           -->
<!-- ls_output = run('cd scratch; ls',shell=True).decode()           -->
<!-- }}}      -->
```bash
$ python acme ACME-solver.ini.rendered
{{acme_output}}
$ ls
{{ls_output}}
```

An there you are, full-blown unit support for a tool that does not support them.
