Skip to content

Commit

Permalink
Update task
Browse files Browse the repository at this point in the history
  • Loading branch information
sethvs committed Feb 8, 2024
1 parent 3cefcd5 commit 1894a3b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
29 changes: 29 additions & 0 deletions .helpers/updateHelp.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
$docspath = './docs/en-us'
$helppath = './en-us'

# Generate xml
New-ExternalHelp -Path $docspath -OutputPath $helppath -Force

# Add two empty lines after all examples except the last
foreach ($file in (Get-ChildItem -Path $helppath -Filter *.xml).FullName)
{
(Get-Content -Path $file -Raw) `
-replace "</maml:para>\r\n </dev:remarks>\r\n </command:example>\r\n <command:example>",
"</maml:para>`n <maml:para/>`n <maml:para/>`n </dev:remarks>`n </command:example>`n <command:example>" |
Set-Content -Path $file
}

$docspath = './docs/ru-ru'
$helppath = './ru-ru'

# Generate xml
New-ExternalHelp -Path $docspath -OutputPath $helppath -Force

# Add two empty lines after all examples except the last
foreach ($file in (Get-ChildItem -Path $helppath -Filter *.xml).FullName)
{
(Get-Content -Path $file -Raw) `
-replace "</maml:para>\r\n </dev:remarks>\r\n </command:example>\r\n <command:example>",
"</maml:para>`n <maml:para/>`n <maml:para/>`n </dev:remarks>`n </command:example>`n <command:example>" |
Set-Content -Path $file
}
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
{
"label": "UpdateHelp",
"type": "shell",
"command": "Set-Location ${workspaceFolder}; New-ExternalHelp -Path ./docs/en-us -OutputPath ./en-us -Force; New-ExternalHelp -Path ./docs/ru-ru -OutputPath ./ru-ru -Force",
"command": "Set-Location ${workspaceFolder}; ./.helpers/updateHelp.ps1",
"group": {
"kind": "none",
"isDefault": true
Expand Down

0 comments on commit 1894a3b

Please sign in to comment.