Skip to content

Commit

Permalink
Merge pull request #162 from StartAutomating/HelpingOut
Browse files Browse the repository at this point in the history
HelpOut 0.5.1
  • Loading branch information
StartAutomating authored Nov 17, 2023
2 parents 3b0eda8 + c10ca1b commit 40c3dfa
Show file tree
Hide file tree
Showing 22 changed files with 57 additions and 927 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
### HelpOut 0.5.1:

* Save-MarkdownHelp - -OutputPath now handles relative paths (#159)
* Markdown Help Formatting - Trimming Whitespace (#161) (rendering should be unchanged)

Thanks @PrzemyslawKlys !

---

### HelpOut 0.5:

* Install-MAML - Adding -NoComment (#157)
Expand Down
14 changes: 9 additions & 5 deletions Formatting/PowerShell.Markdown.Help.format.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ If the command sets a ```[ConfirmImpact("Medium")]``` which is lower than ```$co
}

$descriptionLines = @($parameter.description | Out-String -Width 1mb) -split '(?>\r\n|\n)'
$descriptionLines -replace '^-\s', '* ' -join [Environment]::NewLine
$descriptionLines -replace '^-\s', '* ' -ne '' -join [Environment]::NewLine

if (-not $helpObject.NoValidValueEnumeration -and $helpCmd -and $helpCmd.Parameters.($parameter.Name)) {
$parameterMetadata = $helpCmd.Parameters[$parameter.Name]
Expand Down Expand Up @@ -244,7 +244,7 @@ If the command sets a ```[ConfirmImpact("Medium")]``` which is lower than ```$co

Format-Markdown -MarkdownTable -InputObject ([PSCustomObject]$parameterTableInfo)

[Environment]::NewLine * 2
[Environment]::NewLine
}
}
}
Expand Down Expand Up @@ -434,14 +434,18 @@ If the command sets a ```[ConfirmImpact("Medium")]``` which is lower than ```$co
& $MarkdownSections.$sectionName
} else { $null }
if ($sectionContent) {
[Environment]::NewLine
if ($sectionContent -notmatch '^[\r\n]') {
[Environment]::NewLine
}
$sectionContent
[Environment]::NewLine
if ($sectionContent -notmatch '[\r\n]$') {
[Environment]::NewLine
}
if ($sectionCounter -lt $orderOfSections.Length -and $sectionContent -notmatch '---\s{0,}$') {
'---'
}
}
}

) -join [Environment]::NewLine).Trim()
) -join [Environment]::NewLine -replace "(?>\r\n|\n){3,}", ([Environment]::NewLine * 2)).Trim()
}
16 changes: 8 additions & 8 deletions HelpOut-Help.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<maml:description>
<maml:para>Gets MAML help</maml:para>
</maml:description>
<dev:version>0.5</dev:version>
<dev:version>0.5.1</dev:version>
</command:details>
<maml:description>
<maml:para>Gets help for a given command, as MAML (Microsoft Assistance Markup Language) xml.</maml:para>
Expand Down Expand Up @@ -400,7 +400,7 @@ This slightly reduces the size of the MAML file, and reduces the rate of changes
<maml:description>
<maml:para>Gets Markdown Help</maml:para>
</maml:description>
<dev:version>0.5</dev:version>
<dev:version>0.5.1</dev:version>
</command:details>
<maml:description>
<maml:para>Gets Help for a given command, in Markdown</maml:para>
Expand Down Expand Up @@ -703,7 +703,7 @@ Get-MarkdownHelp Get-Help # Get-MarkdownHelp is a wrapper for Get-Help </dev:cod
<maml:description>
<maml:para>Gets a script's references</maml:para>
</maml:description>
<dev:version>0.5</dev:version>
<dev:version>0.5.1</dev:version>
</command:details>
<maml:description>
<maml:para>Gets the external references of a given PowerShell command. These are the commands the script calls, and the types the script uses.</maml:para>
Expand Down Expand Up @@ -829,7 +829,7 @@ Get-MarkdownHelp Get-Help # Get-MarkdownHelp is a wrapper for Get-Help </dev:cod
<maml:description>
<maml:para>Gets a Script's story</maml:para>
</maml:description>
<dev:version>0.5</dev:version>
<dev:version>0.5.1</dev:version>
</command:details>
<maml:description>
<maml:para>Gets the Script's "Story"</maml:para>
Expand Down Expand Up @@ -992,7 +992,7 @@ Get-MarkdownHelp Get-Help # Get-MarkdownHelp is a wrapper for Get-Help </dev:cod
<maml:description>
<maml:para>Installs MAML into a module</maml:para>
</maml:description>
<dev:version>0.5</dev:version>
<dev:version>0.5.1</dev:version>
</command:details>
<maml:description>
<maml:para>Installs MAML into a module. </maml:para>
Expand Down Expand Up @@ -1428,7 +1428,7 @@ This slightly reduces the size of the MAML file, and reduces the rate of changes
<maml:description>
<maml:para>Determines the percentage of documentation</maml:para>
</maml:description>
<dev:version>0.5</dev:version>
<dev:version>0.5.1</dev:version>
</command:details>
<maml:description>
<maml:para>Determines the percentage of documentation in a given script</maml:para>
Expand Down Expand Up @@ -1571,7 +1571,7 @@ This slightly reduces the size of the MAML file, and reduces the rate of changes
<maml:description>
<maml:para>Saves a Module's MAML</maml:para>
</maml:description>
<dev:version>0.5</dev:version>
<dev:version>0.5.1</dev:version>
</command:details>
<maml:description>
<maml:para>Generates a Module's MAML file, and then saves it to the appropriate location.</maml:para>
Expand Down Expand Up @@ -1832,7 +1832,7 @@ This slightly reduces the size of the MAML file, and reduces the rate of changes
<maml:description>
<maml:para>Saves a Module's Markdown Help</maml:para>
</maml:description>
<dev:version>0.5</dev:version>
<dev:version>0.5.1</dev:version>
</command:details>
<maml:description>
<maml:para>Get markdown help for each command in a module and saves it to the appropriate location.</maml:para>
Expand Down
16 changes: 10 additions & 6 deletions HelpOut.format.ps1xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-16"?>
<!-- Generated with EZOut 2.0.1: Install-Module EZOut or https://github.com/StartAutomating/EZOut -->
<!-- Generated with EZOut 2.0.3: Install-Module EZOut or https://github.com/StartAutomating/EZOut -->
<Configuration>
<ViewDefinitions>
<View>
Expand Down Expand Up @@ -321,7 +321,7 @@ If the command sets a ```[ConfirmImpact("Medium")]``` which is lower than ```$co
}

$descriptionLines = @($parameter.description | Out-String -Width 1mb) -split '(?&gt;\r\n|\n)'
$descriptionLines -replace '^-\s', '* ' -join [Environment]::NewLine
$descriptionLines -replace '^-\s', '* ' -ne '' -join [Environment]::NewLine

if (-not $helpObject.NoValidValueEnumeration -and $helpCmd -and $helpCmd.Parameters.($parameter.Name)) {
$parameterMetadata = $helpCmd.Parameters[$parameter.Name]
Expand Down Expand Up @@ -357,7 +357,7 @@ If the command sets a ```[ConfirmImpact("Medium")]``` which is lower than ```$co

&amp; ${HelpOut_Format-Markdown} -MarkdownTable -InputObject ([PSCustomObject]$parameterTableInfo)

[Environment]::NewLine * 2
[Environment]::NewLine
}
}
}
Expand Down Expand Up @@ -547,16 +547,20 @@ If the command sets a ```[ConfirmImpact("Medium")]``` which is lower than ```$co
&amp; $MarkdownSections.$sectionName
} else { $null }
if ($sectionContent) {
[Environment]::NewLine
if ($sectionContent -notmatch '^[\r\n]') {
[Environment]::NewLine
}
$sectionContent
[Environment]::NewLine
if ($sectionContent -notmatch '[\r\n]$') {
[Environment]::NewLine
}
if ($sectionCounter -lt $orderOfSections.Length -and $sectionContent -notmatch '---\s{0,}$') {
'---'
}
}
}

) -join [Environment]::NewLine).Trim()
) -join [Environment]::NewLine -replace "(?&gt;\r\n|\n){3,}", ([Environment]::NewLine * 2)).Trim()
</ScriptBlock>
</ExpressionBinding>
</CustomItem>
Expand Down
10 changes: 5 additions & 5 deletions HelpOut.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,20 @@
ModuleToProcess='HelpOut.psm1'
FormatsToProcess='HelpOut.format.ps1xml'
TypesToProcess='HelpOut.types.ps1xml'
ModuleVersion='0.5'
ModuleVersion='0.5.1'
PrivateData = @{
PSData = @{
ProjectURI = 'https://github.com/StartAutomating/HelpOut'
LicenseURI = 'https://github.com/StartAutomating/HelpOut/blob/master/LICENSE'

Tags = 'Markdown', 'Help','PowerShell'
ReleaseNotes = @'
### HelpOut 0.5:
### HelpOut 0.5.1:
* Install-MAML - Adding -NoComment (#157)
* Install-MAML - Adding -Minify (#158)
* Save-MarkdownHelp - -OutputPath now handles relative paths (#159)
* Markdown Help Formatting - Trimming Whitespace (#161) (rendering should be unchanged)
Thanks @potatoqualitee !
Thanks @PrzemyslawKlys !
---
Expand Down
2 changes: 1 addition & 1 deletion HelpOut.types.ps1xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-16"?>
<!-- Generated with EZOut 2.0.1: Install-Module EZOut or https://github.com/StartAutomating/EZOut -->
<!-- Generated with EZOut 2.0.3: Install-Module EZOut or https://github.com/StartAutomating/EZOut -->
<Types>
<Type>
<Name>PowerShell.Markdown.Help</Name>
Expand Down
3 changes: 3 additions & 0 deletions Save-MarkdownHelp.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@
} else {
Join-Path $theModuleRoot "docs" # Otherwise, it's the docs subdirectory.
}
} else {
# If -OutputPath was provided, we want to make sure it becomes an absolute path
$OutputPath = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($OutputPath)
}

# If the -OutputPath does not exist
Expand Down
3 changes: 3 additions & 0 deletions allcommands.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1573,6 +1573,9 @@ function Save-MarkdownHelp
} else {
Join-Path $theModuleRoot "docs" # Otherwise, it's the docs subdirectory.
}
} else {
# If -OutputPath was provided, we want to make sure it becomes an absolute path
$OutputPath = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($OutputPath)
}

# If the -OutputPath does not exist
Expand Down
9 changes: 9 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
### HelpOut 0.5.1:

* Save-MarkdownHelp - -OutputPath now handles relative paths (#159)
* Markdown Help Formatting - Trimming Whitespace (#161) (rendering should be unchanged)

Thanks @PrzemyslawKlys !

---

### HelpOut 0.5:

* Install-MAML - Adding -NoComment (#157)
Expand Down
Loading

0 comments on commit 40c3dfa

Please sign in to comment.