diff --git a/www/docs/en/dev/config_ref/index.md b/www/docs/en/dev/config_ref/index.md index 7d5878d33e..d88d518cb8 100644 --- a/www/docs/en/dev/config_ref/index.md +++ b/www/docs/en/dev/config_ref/index.md @@ -220,7 +220,10 @@ platform. See [Customize icons topic](images.html) for more information. ``` ## plugin - Specifies details about what plugin to restore during a prepare. + Specifies details about what plugin to restore during a prepare. This element + is automatically added to a project's `config.xml` when a plugin is added using + the `--save` flag. See the [CLI reference][plugin_cli] for more information on + adding plugins. Attributes(type) | Description ----------------- | ------------ @@ -234,6 +237,31 @@ platform. See [Customize icons topic](images.html) for more information. ``` +### variable + Persists the value of a CLI variable to be used when restoring a plugin during a + prepare. This element is added to `config.xml` when a plugin that uses CLI variables + is added using the `--save` flag. See the [CLI reference][plugin_cli] for more + information on adding plugins. + + Note that this value is only used when the plugin is restored to the project during a + prepare, changing it will *not* change the value used by the plugin in the current + project. In order for changes to this value to take effect, remove the plugin from the + project and restore it by running `cordova prepare`. See the + [preference element][plugin_preference] of `plugin.xml` for more details on CLI variables. + + Attributes(type) | Description + ----------------- | ------------ + name(string) | *Required*
Name of the CLI variable. Can only contain capital letters, digits, and underscores. + value(string) | *Required*
Value of the CLI variable to be used when restoring the parent plugin during a prepare. + + Examples: + + ```xml + + + + ``` + ## preference Sets various options as pairs of name/value attributes. Each preference's name is case-insensitive. Many preferences are unique to specific platforms, and will be indicated as such. @@ -472,7 +500,9 @@ platform. See [Customize icons topic](images.html) for more information. [uses-sdk]: http://developer.android.com/guide/topics/manifest/uses-sdk-element.html [platform_spec]: ../reference/cordova-cli/index.html#platform-spec +[plugin_preference]: ../plugin_ref/spec.html#preference [plugin_spec]: ../reference/cordova-cli/index.html#plugin-spec +[plugin_cli]: ../reference/cordova-cli/index.html#cordova-plugin-command [whitelist_navigation]: ../reference/cordova-plugin-whitelist/index.html#navigation-whitelist [whitelist_intent]: ../reference/cordova-plugin-whitelist/index.html#intent-whitelist [statusbar_plugin]: ../reference/cordova-plugin-statusbar/ diff --git a/www/docs/en/dev/plugin_ref/spec.md b/www/docs/en/dev/plugin_ref/spec.md index 2fc4b0247e..b9d0a849cf 100644 --- a/www/docs/en/dev/plugin_ref/spec.md +++ b/www/docs/en/dev/plugin_ref/spec.md @@ -506,13 +506,21 @@ Certain variable names should be reserved, like `$PACKAGE_NAME`. This is the rev As seen in the previous section, sometimes plugin might require user to specify values for their variables. To make those variable mandatory, the `` tag needs to contain a `` tag. The CLI checks that these required preferences are passed in. If not, it should warn the user how to pass the variable in and exit with a non-zero code. +Preferences can be referenced elsewhere in `plugin.xml` using the syntax `$PREFERENCE_NAME`. Attributes(type) | Description ---------------- | ------------ -name(string) | *Required*
Name of the variable. +name(string) | *Required*
Name of the variable. Can only contain capital letters, digits, and underscores. default(string) | Default value of the variable. If present, its value will be used and no error will be emitted in case user does not enter any value. Example: ```xml - + + + + + $MY_CUSTOM_STRING + ```