Skip to content

Commit

Permalink
📝 Update config reference docs
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenixr-codes committed Oct 17, 2024
1 parent decd519 commit 861f4e1
Showing 1 changed file with 75 additions and 0 deletions.
75 changes: 75 additions & 0 deletions manual/src/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,16 +172,91 @@ extra-watch-dirs = ["plugins"]

### The `name` field { #the-plugin-name-field }

A plugin can optionally be granted a name which is useful as you can more easily identify what output
came from which plugin during the build process.

```toml
[[plugin]]
name = "Greeter"
run = "plugins/greet.rb"
with = "ruby"
```


### The `run` and `with` fields

The `run` and `with` fields are used to specify the program used to run the plugin.

```toml
[[plugin]]
run = "first-argument"
with = "program"
args = ["second-argument", "third-argument"]
```

Alternatively, you can use the following form:

```toml
[[plugin]]
run = "program"
args = ["first-argument", "second-argument", "third-argument"]
```

Both snippets effectively do the same and if you use the combination of `with` + `run` or just `run`
pretty much depends on your taste and the program you are invoking. Let's look at an example which
uses a Dart program as a plugin.

In the console you would write:

```console
dart run plugins/hello.dart
```

To use it as a plugin, we add it to the configuration file:

```toml
[[plugin]]
run = "run"
with = "dart"
args = ["plugins/hello.dart"]
```

But we can use the alternative which would look better in this case:

```toml
run = "dart"
args = ["run", "plugins/hello.dart"]
```


### The `args` and `options` fields

The `args` array passes each value to the program as an argument whereas the value used for `options`
is serialized into JSON and passed as a single argument to the plugin.


### The `when` field

```admonish title="See Also"
[Filters](./plugins.md#filters)
```


### The `threaded` field

```admonish
This field is unused but might be used in the future.
```


### The `panic` field


```admonish
This field is unused but might be used in the future.
```


## The `[BP]`, `[RP]`, `[SP]` and `[WT]` sections

These sections can be used to for pack-specific configurations.
Expand Down

0 comments on commit 861f4e1

Please sign in to comment.