|
| 1 | +# Configuring snippets |
| 2 | + |
| 3 | +PSDocs for Azure supports a number of snippets that can be included in documentation. |
| 4 | +This feature can be enabled by using the following configuration options. |
| 5 | + |
| 6 | +## Configuration |
| 7 | + |
| 8 | +!!! Tip |
| 9 | + Each of these configuration options are set within the `ps-docs.yaml` file. |
| 10 | + To learn how to set configuration options see [Configuring options][1]. |
| 11 | + |
| 12 | + [1]: configuring-options.md |
| 13 | + |
| 14 | +### Skip function default value parameters |
| 15 | + |
| 16 | +:octicons-milestone-24: v0.4.0 |
| 17 | + |
| 18 | +This configuration option determines if parameters with a function defaultValue are included in snippets. |
| 19 | +By default, a parameters with a function default value are not included in snippets. |
| 20 | +i.e. If a parameter default value is set to `[resourceGroup.location]` it is not included in snippets. |
| 21 | + |
| 22 | +Syntax: |
| 23 | + |
| 24 | +```yaml |
| 25 | +configuration: |
| 26 | + AZURE_SNIPPET_SKIP_DEFAULT_VALUE_FN: bool # Either true or false |
| 27 | +``` |
| 28 | +
|
| 29 | +Default: |
| 30 | +
|
| 31 | +```yaml |
| 32 | +# YAML: The default AZURE_SNIPPET_SKIP_DEFAULT_VALUE_FN configuration option |
| 33 | +configuration: |
| 34 | + AZURE_SNIPPET_SKIP_DEFAULT_VALUE_FN: true |
| 35 | +``` |
| 36 | +
|
| 37 | +Example: |
| 38 | +
|
| 39 | +```yaml |
| 40 | +# YAML: Include parameters with a function default value in snippets. |
| 41 | +configuration: |
| 42 | + AZURE_SNIPPET_SKIP_DEFAULT_VALUE_FN: false |
| 43 | +``` |
| 44 | +
|
| 45 | +### Skip optional parameters |
| 46 | +
|
| 47 | +:octicons-milestone-24: v0.4.0 |
| 48 | +
|
| 49 | +This configuration option determines optional parameters are included in snippets. |
| 50 | +By default, optional parameters are included in snippets. |
| 51 | +To ignore optional parameter, set this option to `false`. |
| 52 | + |
| 53 | +Syntax: |
| 54 | + |
| 55 | +```yaml |
| 56 | +configuration: |
| 57 | + AZURE_SNIPPET_SKIP_OPTIONAL_PARAMETER: bool # Either true or false |
| 58 | +``` |
| 59 | + |
| 60 | +Default: |
| 61 | + |
| 62 | +```yaml |
| 63 | +# YAML: The default AZURE_SNIPPET_SKIP_OPTIONAL_PARAMETER configuration option |
| 64 | +configuration: |
| 65 | + AZURE_SNIPPET_SKIP_OPTIONAL_PARAMETER: false |
| 66 | +``` |
| 67 | + |
| 68 | +Example: |
| 69 | + |
| 70 | +```yaml |
| 71 | +# YAML: Do not include optional parameters in snippets |
| 72 | +configuration: |
| 73 | + AZURE_SNIPPET_SKIP_OPTIONAL_PARAMETER: true |
| 74 | +``` |
| 75 | + |
| 76 | +### Parameter file snippet |
| 77 | + |
| 78 | +:octicons-milestone-24: v0.2.0 |
| 79 | + |
| 80 | +This configuration option determines if a parameter file snippet is added to documentation. |
| 81 | +By default, a snippet is generated. |
| 82 | +To prevent a parameter file snippet being generated, set this option to `false`. |
| 83 | + |
| 84 | +Syntax: |
| 85 | + |
| 86 | +```yaml |
| 87 | +configuration: |
| 88 | + AZURE_USE_PARAMETER_FILE_SNIPPET: bool |
| 89 | +``` |
| 90 | + |
| 91 | +Default: |
| 92 | + |
| 93 | +```yaml |
| 94 | +# YAML: The default AZURE_USE_PARAMETER_FILE_SNIPPET configuration option |
| 95 | +configuration: |
| 96 | + AZURE_USE_PARAMETER_FILE_SNIPPET: false |
| 97 | +``` |
| 98 | + |
| 99 | +Example: |
| 100 | + |
| 101 | +```yaml |
| 102 | +# YAML: Set the AZURE_USE_PARAMETER_FILE_SNIPPET configuration option to enable expansion |
| 103 | +configuration: |
| 104 | + AZURE_USE_PARAMETER_FILE_SNIPPET: true |
| 105 | +``` |
| 106 | + |
| 107 | +### Command line snippet |
| 108 | + |
| 109 | +:octicons-milestone-24: v0.2.0 |
| 110 | + |
| 111 | +This configuration option determines if a command line snippet is added to documentation. |
| 112 | +By default, this command line snippet is not generated. |
| 113 | +To generate command line snippet, set this option to `true`. |
| 114 | + |
| 115 | +Syntax: |
| 116 | + |
| 117 | +```yaml |
| 118 | +configuration: |
| 119 | + AZURE_USE_COMMAND_LINE_SNIPPET: bool # Either true or false |
| 120 | +``` |
| 121 | + |
| 122 | +Default: |
| 123 | + |
| 124 | +```yaml |
| 125 | +# YAML: The default AZURE_USE_COMMAND_LINE_SNIPPET configuration option is to disable generation |
| 126 | +configuration: |
| 127 | + AZURE_USE_COMMAND_LINE_SNIPPET: false |
| 128 | +``` |
| 129 | + |
| 130 | +Example: |
| 131 | + |
| 132 | +```yaml |
| 133 | +# YAML: To enable command line snippet |
| 134 | +configuration: |
| 135 | + AZURE_USE_COMMAND_LINE_SNIPPET: true |
| 136 | +``` |
0 commit comments