Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions src/out-html-template.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@
<!--
<auto-generated>
<synopsis>
This code was generated by a tool. on: $(Get-Date)
This code was generated by a psDoc. on: $(Get-Date)
Get it here: https://github.com/ChaseFlorell/psDoc
</synopsis>
<description>
If you'd like to regenerate the documentation, please open up powershell and run

> .\psDoc.ps1 -moduleName NameOfYourModule

If the documentation is incomplete, or eronious,
please edit the comments at the top of the module method within it's respecive .ps1 file.

> Import-Module $moduleName
> .\psDoc.ps1 -moduleName $moduleName

If the documentation is incomplete, or erroneous, please edit the comments
at the top of the module method within it's respective .ps1 file.
</description>
</auto-generated>
-->
Expand Down Expand Up @@ -125,8 +127,8 @@ $commandsHelp | % {
$syn = FixString($_.synopsis)
if(!($syn).StartsWith($(FixString($_.Name)))){
@"
<p>$syn</p>
<p>$(FixString(($_.Description | out-string).Trim()) $true)</p>
<p>$(Convert-MdToHtml $syn)</p>
<p>$(Convert-MdToHtml $_.Description )</p>
"@
}
@"
Expand Down Expand Up @@ -186,7 +188,7 @@ $commandsHelp | % {
<tr>
<td><nobr>-$(FixString($_.Name))</nobr></td>
<td class="visible-lg visible-md">$(FixString($_.Aliases))</td>
<td>$(FixString(($_.Description | out-string).Trim()) $true)</td>
<td>$(Convert-MdToHtml $_.Description )</td>
<td class="visible-lg visible-md">$(FixString($_.Required))</td>
<td class="visible-lg">$(FixString($_.PipelineInput))</td>
<td class="visible-lg">$(FixString($_.DefaultValue))</td>
Expand Down Expand Up @@ -241,8 +243,8 @@ $commandsHelp | % {
$_.examples.example | % {
@"
<strong>$(FixString($_.title.Trim(('-',' '))))</strong>
<pre class="brush: ps">$(FixString($_.code | out-string ).Trim())</pre>
<div>$(FixString($_.remarks | out-string ).Trim())</div>
<pre class="brush: ps">$(FixString($_.code | out-string ).Trim())</pre>
<div>$(Convert-MdToHtml $_.remarks )</div>
"@
}
@"
Expand Down
5 changes: 5 additions & 0 deletions src/psDoc.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ function FixString ($in = '', [bool]$includeBreaks = $false){
function Update-Progress($name, $action){
Write-Progress -Activity "Rendering $action for $name" -CurrentOperation "Completed $progress of $totalCommands." -PercentComplete $(($progress/$totalCommands)*100)
}

function Convert-MdToHtml ($unfixedString){
$(ConvertFrom-Markdown -InputObject (FixString(($unfixedString | out-string).Trim())) | Select-Object -exp html)
}

$i = 0
$commandsHelp = (Get-Command -module $moduleName) | get-help -full | Where-Object {! $_.name.EndsWith('.ps1')}

Expand Down