|
47 | 47 |
|
48 | 48 | Write-Host '::group::Build docs - Generate markdown help - Raw' |
49 | 49 | Install-PSModule -Path $ModuleOutputFolder |
50 | | - Write-Host ($ModuleName | Get-Module) |
51 | | - $null = New-MarkdownHelp -Module $ModuleName -OutputFolder $DocsOutputFolder -Force -Verbose |
| 50 | + $moduleInfo = Get-Module $ModuleName |
| 51 | + Write-Host $moduleInfo |
| 52 | + $null = New-MarkdownCommandHelp -ModuleInfo $moduleInfo -OutputFolder $DocsOutputFolder -Force -Verbose |
52 | 53 | Get-ChildItem -Path $DocsOutputFolder -Recurse -Force -Include '*.md' | ForEach-Object { |
53 | 54 | $fileName = $_.Name |
54 | 55 | Write-Host "::group:: - [$fileName]" |
|
88 | 89 |
|
89 | 90 | Write-Host '::group::Build docs - Structure markdown files to match source files' |
90 | 91 | $PublicFunctionsFolder = Join-Path $ModuleSourceFolder.FullName 'functions\public' | Get-Item |
91 | | - Get-ChildItem -Path $DocsOutputFolder -Recurse -Force -Include '*.md' | ForEach-Object { |
| 92 | + $moduleDocsFolder = Join-Path $DocsOutputFolder.FullName $ModuleName |
| 93 | + Get-ChildItem -Path $moduleDocsFolder -Recurse -Force -Include '*.md' | ForEach-Object { |
92 | 94 | $file = $_ |
93 | | - $relPath = [System.IO.Path]::GetRelativePath($DocsOutputFolder.FullName, $file.FullName) |
| 95 | + $relPath = [System.IO.Path]::GetRelativePath($moduleDocsFolder, $file.FullName) |
94 | 96 | Write-Host " - $relPath" |
95 | 97 | Write-Host " Path: $file" |
96 | 98 |
|
97 | 99 | # find the source code file that matches the markdown file |
98 | 100 | $scriptPath = Get-ChildItem -Path $PublicFunctionsFolder -Recurse -Force | Where-Object { $_.Name -eq ($file.BaseName + '.ps1') } |
99 | 101 | Write-Host " PS1 path: $scriptPath" |
100 | | - $docsFilePath = ($scriptPath.FullName).Replace($PublicFunctionsFolder.FullName, $DocsOutputFolder.FullName).Replace('.ps1', '.md') |
| 102 | + $docsFilePath = ($scriptPath.FullName).Replace($PublicFunctionsFolder.FullName, $moduleDocsFolder).Replace('.ps1', '.md') |
101 | 103 | Write-Host " MD path: $docsFilePath" |
102 | 104 | $docsFolderPath = Split-Path -Path $docsFilePath -Parent |
103 | 105 | $null = New-Item -Path $docsFolderPath -ItemType Directory -Force |
104 | 106 | Move-Item -Path $file.FullName -Destination $docsFilePath -Force |
105 | 107 | } |
106 | 108 |
|
107 | 109 | Write-Host '::group::Build docs - Move markdown files from source files to docs' |
| 110 | + $moduleDocsFolder = Join-Path $DocsOutputFolder.FullName $ModuleName |
108 | 111 | Get-ChildItem -Path $PublicFunctionsFolder -Recurse -Force -Include '*.md' | ForEach-Object { |
109 | 112 | $file = $_ |
110 | 113 | $relPath = [System.IO.Path]::GetRelativePath($PublicFunctionsFolder.FullName, $file.FullName) |
111 | 114 | Write-Host " - $relPath" |
112 | 115 | Write-Host " Path: $file" |
113 | 116 |
|
114 | | - $docsFilePath = ($file.FullName).Replace($PublicFunctionsFolder.FullName, $DocsOutputFolder.FullName) |
| 117 | + $docsFilePath = ($file.FullName).Replace($PublicFunctionsFolder.FullName, $moduleDocsFolder) |
115 | 118 | Write-Host " MD path: $docsFilePath" |
116 | 119 | $docsFolderPath = Split-Path -Path $docsFilePath -Parent |
117 | 120 | $null = New-Item -Path $docsFolderPath -ItemType Directory -Force |
|
0 commit comments