Skip to content

Commit 6881453

Browse files
authored
Fix plugin placeholder docs (#2254)
Add the ProjectDir placeholder in the plugin docs
1 parent 226349a commit 6881453

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

docs/app/docs/guides/creating_plugins.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,10 @@ Plugins are defined as Go JSON Template files, using the following schema:
7777
],
7878
"scripts": {
7979
"<key>": "<value>"
80-
}
80+
}
8181
},
8282
"include": [
83-
"<path_to_plugin>"
83+
"<path_to_plugin>"
8484
]
8585
}
8686
```
@@ -91,7 +91,8 @@ A plugin can define services by adding a `process-compose.yaml` file in its `cre
9191

9292
Devbox's Plugin System provides a few special placeholders that should be used when specifying paths for env variables and helper files:
9393

94-
* `{{ .DevboxDirRoot }}` – points to the root folder of their project, where the user's `devbox.json` is stored.
94+
* `{{ .DevboxProjectDir }}` – points to the root folder of their project, where the user's `devbox.json` is stored.
95+
* `{{ .DevboxDirRoot }}` - points to `<projectDir>/devbox.d`. This directory is public and added to source control by default.
9596
* `{{ .DevboxDir }}` – points to `<projectDir>/devbox.d/<plugin.name>`. This directory is public and added to source control by default. This directory is not modified or recreated by Devbox after the initial package installation. You should use this location for files that a user will want to modify and check-in to source control alongside their project (e.g., `.conf` files or other configs).
9697
* `{{ .Virtenv }}` – points to `<projectDir>/.devbox/virtenv/<plugin_name>` whenever the plugin activates. This directory is hidden and added to `.gitignore` by default You should use this location for files or variables that a user should not check-in or edit directly. Files in this directory should be considered managed by Devbox, and may be recreated or modified after the initial installation.
9798

@@ -111,9 +112,9 @@ Special usage instructions or notes to display when your plugin activates or whe
111112

112113
#### `packages` *string[] | object*
113114

114-
A list of packages that the plugin will install when activated or included in a package. This section follows the same format as [`packages`](../configuration.md#packages) section in a project's `devbox.json`.
115+
A list of packages that the plugin will install when activated or included in a package. This section follows the same format as [`packages`](../configuration.md#packages) section in a project's `devbox.json`.
115116

116-
Packages installed by a plugin can be overridden if a user installs a different version of the same package in their `devbox.json` config. For example, if a plugin installs `[email protected]`, and a user's devbox.json installs `[email protected]`, the project will use `[email protected]`.
117+
Packages installed by a plugin can be overridden if a user installs a different version of the same package in their `devbox.json` config. For example, if a plugin installs `[email protected]`, and a user's devbox.json installs `[email protected]`, the project will use `[email protected]`.
117118

118119
#### `env` *object*
119120

@@ -168,12 +169,12 @@ To run multiple commands in a single script, you can pass them as an array:
168169
}
169170
}
170171
}
171-
```
172-
Scripts defined in a plugin will be overridden if a user's `devbox.json` defines a script with the same name. For example, if both the plugin and the devbox.json that includes it defined a `print_once` script, the version in the user's `devbox.json` will take precedence in the shell.
172+
```
173+
Scripts defined in a plugin will be overridden if a user's `devbox.json` defines a script with the same name. For example, if both the plugin and the devbox.json that includes it defined a `print_once` script, the version in the user's `devbox.json` will take precedence in the shell.
173174

174175
#### `include` *string[]*
175176

176-
Include can be used to explicitly add extra configuration from [plugins](../guides/plugins.md) to your Devbox project. Plugins are parsed and merged in the order they are listed.
177+
Include can be used to explicitly add extra configuration from [plugins](../guides/plugins.md) to your Devbox project. Plugins are parsed and merged in the order they are listed.
177178

178179
Note that in the event of a conflict, plugins near the end of the list will override plugins at the beginning of the list. Likewise, if a setting in your plugin.json conflicts with an included plugin, your setting will take precedence.
179180
```json

0 commit comments

Comments
 (0)