Skip to content

Commit

Permalink
Added support for localized strings #91 (#102)
Browse files Browse the repository at this point in the history
- Added support for localized strings #91
- Fixes and invariant culture
- Fix culture for unit tests
- Documentation updates
  • Loading branch information
BernieWhite authored Jan 4, 2021
1 parent ea36863 commit 378d1b2
Show file tree
Hide file tree
Showing 66 changed files with 1,493 additions and 344 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
},
"cSpell.words": [
"cmdlet",
"cmdlets",
"hashtable",
"runspace"
],
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

## Unreleased

What's changed since pre-release v0.7.0-B2008035:

- Engine features:
- Added support for localized strings using the `$LocalizedData` variable. [#91](https://github.com/BernieWhite/PSDocs/issues/91)
- Added configuration for setting output options. [#105](https://github.com/BernieWhite/PSDocs/issues/105)
- Added parameter alias `-MarkdownEncoding` on `New-PSDocumentOption` for `-Encoding`. [#106](https://github.com/BernieWhite/PSDocs/issues/106)
- Bug fixes:
- Fixed inconsistencies with default options file name. [#103](https://github.com/BernieWhite/PSDocs/issues/103)

## v0.7.0-B2008035 (pre-release)

What's changed since pre-release v0.7.0-B2008022:
Expand Down
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,19 @@ The following commands exist in the `PSDocs.Dsc` module:
The following conceptual topics exist in the `PSDocs` module:

- [Options](docs/concepts/PSDocs/en-US/about_PSDocs_Options.md)
- [Markdown.WrapSeparator](docs/concepts/PSDocs/en-US/about_PSDocs_Options.md#wrap-separator)
- [Markdown.Encoding](docs/concepts/PSDocs/en-US/about_PSDocs_Options.md#encoding)
- [Markdown.SkipEmptySections](docs/concepts/PSDocs/en-US/about_PSDocs_Options.md#skip-empty-sections)
- [Markdown.ColumnPadding](docs/concepts/PSDocs/en-US/about_PSDocs_Options.md#column-padding)
- [Markdown.UseEdgePipes](docs/concepts/PSDocs/en-US/about_PSDocs_Options.md#use-edge-pipes)
- [Execution.LanguageMode](docs/concepts/PSDocs/en-US/about_PSDocs_Options.md#language-mode)
- [Execution.LanguageMode](docs/concepts/PSDocs/en-US/about_PSDocs_Options.md#executionlanguagemode)
- [Markdown.ColumnPadding](docs/concepts/PSDocs/en-US/about_PSDocs_Options.md#markdowncolumnpadding)
- [Markdown.Encoding](docs/concepts/PSDocs/en-US/about_PSDocs_Options.md#markdownencoding)
- [Markdown.SkipEmptySections](docs/concepts/PSDocs/en-US/about_PSDocs_Options.md#markdownskipemptysections)
- [Markdown.UseEdgePipes](docs/concepts/PSDocs/en-US/about_PSDocs_Options.md#markdownuseedgepipes)
- [Markdown.WrapSeparator](docs/concepts/PSDocs/en-US/about_PSDocs_Options.md#markdownwrapseparator)
- [Output.Culture](docs/concepts/PSDocs/en-US/about_PSDocs_Options.md#outputculture)
- [Output.Path](docs/concepts/PSDocs/en-US/about_PSDocs_Options.md#outputpath)
- [Variables](docs/concepts/PSDocs/en-US/about_PSDocs_Variables.md)
- [$Culture](docs/concepts/PSDocs/en-US/about_PSDocs_Variables.md#culture)
- [$Document](docs/concepts/PSDocs/en-US/about_PSDocs_Variables.md#document)
- [$InstanceName](docs/concepts/PSDocs/en-US/about_PSDocs_Variables.md#instancename)
- [$LocalizedData](docs/concepts/PSDocs/en-US/about_PSDocs_Variables.md#localizeddata)
- [$TargetObject](docs/concepts/PSDocs/en-US/about_PSDocs_Variables.md#targetobject)
- [$Section](docs/concepts/PSDocs/en-US/about_PSDocs_Variables.md#section)

Expand Down
1 change: 0 additions & 1 deletion docs/commands/.markdownlint.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
{
"first-line-h1": false,
"line-length": false,
"no-bare-urls": false
}
6 changes: 4 additions & 2 deletions docs/commands/PSDocs/en-US/Get-PSDocumentHeader.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ Get the Yaml header for all markdown files in the current working directory.

### -Path

The path to a specific markdown file or a parent directory containing one or more markdown files. A trailing slash is not required.
The path to a specific markdown file or a parent directory containing one or more markdown files.
A trailing slash is not required.

If a path is not specified the current working path will be used.

Expand All @@ -68,7 +69,8 @@ Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
Expand Down
4 changes: 2 additions & 2 deletions docs/commands/PSDocs/en-US/Invoke-PSDocument.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ Accept wildcard characters: False

### -Culture

One or more culture names when building documents that are localized. i.e. en-AU, en-US
When culture names are specified, the generated document will be written to a culture specific subdirectory.
A list of cultures for building documents such as _en-AU_, and _en-US_.
Documents are written to culture specific subdirectories when multiple cultures are generated.

```yaml
Type: String[]
Expand Down
88 changes: 80 additions & 8 deletions docs/commands/PSDocs/en-US/New-PSDocumentOption.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,24 @@ Create options to configure document generation.

## SYNTAX

### FromPath (Default)

```text
New-PSDocumentOption [-Path <String>] [-Option <PSDocumentOption>] [-Encoding <MarkdownEncoding>]
New-PSDocumentOption [-Path <String>] [-Encoding <MarkdownEncoding>] [-Culture <String[]>]
[-OutputPath <String>] [<CommonParameters>]
```

### FromOption

```text
New-PSDocumentOption -Option <PSDocumentOption> [-Encoding <MarkdownEncoding>] [-Culture <String[]>]
[-OutputPath <String>] [<CommonParameters>]
```

### FromDefault

```text
New-PSDocumentOption [-Default] [-Encoding <MarkdownEncoding>] [-Culture <String[]>] [-OutputPath <String>]
[<CommonParameters>]
```

Expand All @@ -37,14 +53,15 @@ Create markdown using the Sample documentation definition using a wrap separator

### -Option

Additional options that configure document generation. Option also accepts a hashtable to configure options.
Additional options that configure document generation.
Option also accepts a hashtable to configure options.

```yaml
Type: PSDocumentOption
Parameter Sets: (All)
Parameter Sets: FromOption
Aliases:

Required: False
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Expand All @@ -57,24 +74,43 @@ The path to a YAML file containing options.
```yaml
Type: String
Parameter Sets: (All)
Parameter Sets: FromPath
Aliases:

Required: False
Position: Named
Default value: .\.psdocs.yml
Default value: .\ps-docs.yaml
Accept pipeline input: False
Accept wildcard characters: False
```
### -Default
When specified, defaults are used for any options not overridden.
```yaml
Type: SwitchParameter
Parameter Sets: FromDefault
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```
### -Encoding
Specifies the file encoding for generated markdown files. By default, UTF-8 without byte order mark (BOM) will be used. To use UTF-8 with BOM specify `UTF8`.
Sets the option `Markdown.Encoding`.
Specifies the file encoding for generated markdown files.
By default, UTF-8 without byte order mark (BOM) will be used.
See _about_PSDocs_Options_ for more information.

```yaml
Type: MarkdownEncoding
Parameter Sets: (All)
Aliases:
Aliases: MarkdownEncoding
Accepted values: Default, UTF8, UTF7, Unicode, UTF32, ASCII
Required: False
Expand All @@ -84,6 +120,42 @@ Accept pipeline input: False
Accept wildcard characters: False
```

### -Culture

Sets the option `Output.Culture`.
Specifies a list of cultures for building documents such as _en-AU_, and _en-US_.
See _about_PSDocs_Options_ for more information.

```yaml
Type: String[]
Parameter Sets: (All)
Aliases: OutputCulture
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### -OutputPath

Sets the option `Output.Path`.
The option specified one or more custom field bindings.
See _about_PSDocs_Options_ for more information.

```yaml
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
```

### CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
Expand Down
Loading

0 comments on commit 378d1b2

Please sign in to comment.