en-US/about_PSDocs_Options.help.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 |
TOPIC
about_psdocs_options SHORT DESCRIPTION Describes additional options that can be used during markdown generation. LONG DESCRIPTION PSDocs lets you use options when calling `Invoke-PSDocument` to change how documents are generated. This topic describes what options are available, when to and how to use them. Options can be used by: - Using the `-Option` parameter of `Invoke-PSDocument` with an object created with `New-PSDocumentOption` - Using the `-Option` parameter of `Invoke-PSDocument` with a hash table - Using the `-Option` parameter of `Invoke-PSDocument` with a YAML file - Configuring the default options file `.psdocs.yml` As mentioned above, a options object can be created with `New-PSDocumentOption` see cmdlet help for syntax and examples. When using a hash table, `@{}`, one or more options can be specified with the `-Option` parameter using a dotted notation. For example: $option = @{ 'markdown.wrapseparator' = ' '; 'markdown.encoding' = 'UTF8' }; Invoke-PSDocument -Path . -Option $option; `markdown.wrapseparator` is an example of an option that can be used. Please see the following sections for other options can be used. Another option is to use an external file, formatted as YAML, instead of having to create an options object manually each time. This YAML file can be used with `Invoke-PSDocument` to quickly build documentation in a repeatable way. YAML properties are specified using lower camel case, for example: markdown: wrapSeparator: '\' By default PSDocs will automatically look for a file named `psdocs.yml` in the current working directory. Alternatively, you can specify a YAML file in the `-Option` parameter. For example: Invoke-PSDocument -Path . -Option '.\myconfig.yml'. WRAP SEPARATOR This option specifies the character/string to use when wrapping lines in a table cell. When a table cell contains CR and LF characters, these characters must be substituted so that the table in rendered correctly because they also have special meaning in markdown. By default a single space is used. However different markdown parsers may be able to natively render a line break using alternative combinations such as `` or `<br />`. This option can be specified using: # PowerShell: Using the Markdown.WrapSeparator hash table key $option = New-PSDocumentOption -Option @{ 'Markdown.WrapSeparator' = '\' } # psdocs.yml: Using the markdown/wrapSeparator YAML property markdown: wrapSeparator: '\' ENCODING Sets the text encoding used for markdown output files. One of the following values can be used: - Default - UTF8 - UTF7 - Unicode - UTF32 - ASCII By default `Default` is used which is UTF-8 without byte order mark (BOM) is used. This option can be specified using: # PowerShell: Using the Markdown.Encoding hash table key $option = New-PSDocumentOption -Option @{ 'Markdown.Encoding' = 'UTF8' } # psdocs.yml: Using the markdown/encoding YAML property markdown: encoding: UTF8 Additionally `Invoke-PSDocument` has a `-Encoding` parameter. When the `-Encoding` parameter is used, it always takes precedence over an encoding set through `-Option` or `psdocs.yml`. Prior to PSDocs v0.4.0 the only encoding supported was ASCII. SKIP EMPTY SECTIONS From PSDocs v0.5.0 onward, `Section` blocks that are empty are omitted from markdown output by default. i.e. `Markdown.SkipEmptySections` is `$True`. To include empty sections (the same as PSDocs v0.4.0 or older) in markdown output either use the `-Force` parameter on a specific `Section` block or set the option `Markdown.SkipEmptySections` to `$False`. This option can be specified using: # PowerShell: Using the Markdown.SkipEmptySections hash table key $option = New-PSDocumentOption -Option @{ 'Markdown.SkipEmptySections' = $False } # psdocs.yml: Using the markdown/skipEmptySections YAML property markdown: skipEmptySections: false COLUMN PADDING Sets how table column padding should be handled in markdown. This doesn't affect how tables are rendered but can greatly assist readability of markdown source files. The following padding options are available: - None - No padding will be used and column values will directly follow table pipe (`|`) column separators - Single - A single space will be used to pad the column value - MatchHeader - Will pad the header with a single space, then pad the column value, to the same width as the header (default) When a column is set to a specific width with a property expression, `MatchHeader` will be ignored. Columns without a width set will apply `MatchHeader` as normal. Example markdown using `None`: |Name|Value| |----|-----| |Mon|Key| |Really long name|Really long value| Example markdown using `Single`: | Name | Value | | ---- | ----- | | Mon | Key | | Really long name | Really long value | Example markdown using `MatchHeader`: | Name | Value | | ---- | ----- | | Mon | Key | | Really long name | Really long value | This option can be specified using: # PowerShell: Using the Markdown.ColumnPadding hash table key $option = New-PSDocumentOption -Option @{ 'Markdown.ColumnPadding' = 'MatchHeader' } # psdocs.yml: Using the markdown/columnPadding YAML property markdown: columnPadding: MatchHeader USE EDGE PIPES This option determines when pipes on the edge of a table should be used. This option can improve readability of markdown source files, but may not be supported by all markdown renderers. Edge pipes are always required if the table has a single column, so this option only applies for tables with more then one column. The following options for edge pipes are: - WhenRequired - Will not use edge pipes for tables with more when one column (default) - Always - Will always use edge pipes Example markdown using `WhenRequired`: Name|Value ----|----- Mon|Key Example markdown using `Always`: |Name|Value| |----|-----| |Mon|Key| Example markdown using `WhenRequired` and column padding of `MatchHeader`: Name | Value ---- | ----- Mon | Key This option can be specified using: # PowerShell: Using the Markdown.UseEdgePipes hash table key $option = New-PSDocumentOption -Option @{ 'Markdown.UseEdgePipes' = 'WhenRequired' } # psdocs.yml: Using the markdown/useEdgePipes YAML property markdown: useEdgePipes: WhenRequired LANGUAGE MODE Unless PowerShell has been constrained, full language features of PowerShell are available to use within document definitions. In locked down environments, a reduced set of language features may be desired. When PSDocs is executed in an environment configured for Device Guard, only constrained language features are available. The following language modes are available for use in PSDocs: - FullLanguage - ConstrainedLanguage This option can be specified using: # PowerShell: Using the Execution.LanguageMode hash table key $option = New-PSDocumentOption -Option @{ 'Execution.LanguageMode' = 'ConstrainedLanguage' } # psdocs.yml: Using the execution/languageMode YAML property execution: languageMode: ConstrainedLanguage EXAMPLES EXAMPLE PSDOCS.YML # Set markdown options markdown: # Use UTF-8 with BOM encoding: UTF8 skipEmptySections: false wrapSeparator: '\' execution: languageMode: ConstrainedLanguage DEFAULT PSDOCS.YML # These are the default options. # Only properties that differ from the default values need to be specified. markdown: encoding: Default skipEmptySections: true wrapSeparator: ' ' columnPadding: MatchHeader useEdgePipes: WhenRequired execution: languageMode: FullLanguage NOTE An online version of this document is available at https://github.com/BernieWhite/PSDocs/blob/master/docs/concepts/PSDocs/en-US/about_PSDocs_Options.md. SEE ALSO - Invoke-PSDocument - New-PSDocumentOption KEYWORDS - Options - Markdown - PSDocument |