Skip to content

Commit ab2632b

Browse files
⚙️ [Maintenance]: Showcase both docs section landing-page conventions (index.md + folder-named) (#27)
Two example command groups demonstrate both supported ways to give a command group its documentation section landing page. `IndexSection` provides its landing page as `index.md`; `NamedSection` provides its landing page as a file named after the folder (`NamedSection.md`). Document-PSModule renders either overview page as the group's section landing page, so each group appears at `Functions/<Group>/` in the navigation of the published GitHub Pages site. - Demonstrates PSModule/Process-PSModule#372 (group overview pages become section landing pages) - Adopts PSModule/Process-PSModule#377 (caller-provided TestData reaches module tests in consumer repositories) ## New: Two command groups showcasing both landing-page conventions - `IndexSection/` — landing page from `index.md`, with `Get-IndexSectionTest`. - `NamedSection/` — landing page from the folder-named `NamedSection.md`, with `Get-NamedSectionTest`. Each renders as its group's section landing page (`Functions/IndexSection/` and `Functions/NamedSection/`) in the docs navigation. ## Technical Details - Adds `src/functions/public/IndexSection/{index.md, Get-IndexSectionTest.ps1}` and `src/functions/public/NamedSection/{NamedSection.md, Get-NamedSectionTest.ps1}`; both functions mirror the existing `*-PSModuleTest` shape and return `Hello, <Name>!`. - Adds `It` blocks for `Get-IndexSectionTest` and `Get-NamedSectionTest` in `tests/PSModuleTest.Tests.ps1`. - Generated docs place each group overview at `<Group>/index.md`; the rendered site exposes `Functions/IndexSection/index.html` and `Functions/NamedSection/index.html`. - Bumps the Process-PSModule pin (`v6.1.1` → `v6.1.2`) to adopt the fix that exposes caller-provided `TestData` to the module test jobs, keeping the module test matrix green.
1 parent 6a2826f commit ab2632b

6 files changed

Lines changed: 59 additions & 9 deletions

File tree

.github/workflows/Process-PSModule.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,9 @@ permissions:
2727

2828
jobs:
2929
Process-PSModule:
30-
uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@ea19a3eb1293246d1b00e4faae1544442c3be0ec # v6.1.1
30+
uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@d4020f3c9c3621cebae5d8bf4ffaf10f55c1784a # v6.1.2
3131
secrets:
3232
APIKEY: ${{ secrets.APIKEY }}
33-
# Showcase: send data down to the module tests (see tests/Environment.Tests.ps1).
34-
# TestData is a single-line JSON object with optional "secrets" (masked in logs) and
35-
# "variables" (not masked) maps. Every entry is exposed to the module test jobs as
36-
# $env:<name>. Reference a repository secret with the direct "${{ secrets.NAME }}"
37-
# form (single-line values, no quotes or backslashes) and a repository variable with
38-
# ${{ toJSON(vars.NAME) }} so any characters are encoded safely. The folded ">-" scalar
39-
# keeps the whole value on one line so GitHub registers a single log mask. Omit
40-
# TestData entirely when your tests need no data.
4133
TestData: >-
4234
{ "secrets": { "TEST_SECRET": "${{ secrets.TEST_SECRET }}" },
4335
"variables": { "TEST_VARIABLE": ${{ toJSON(vars.TEST_VARIABLE) }} } }
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
function Get-IndexSectionTest {
2+
<#
3+
.SYNOPSIS
4+
Performs tests on a module.
5+
6+
.DESCRIPTION
7+
Performs tests on a module.
8+
9+
.EXAMPLE
10+
Get-IndexSectionTest -Name 'World'
11+
12+
"Hello, World!"
13+
#>
14+
[CmdletBinding()]
15+
param (
16+
# Name of the person to greet.
17+
[Parameter(Mandatory)]
18+
[string] $Name
19+
)
20+
Write-Output "Hello, $Name!"
21+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Index Section
2+
3+
This section's landing page is provided by an `index.md` file.
4+
5+
When Process-PSModule builds the documentation site, this page becomes the landing page for the **Index Section** group in the navigation on GitHub Pages.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
function Get-NamedSectionTest {
2+
<#
3+
.SYNOPSIS
4+
Performs tests on a module.
5+
6+
.DESCRIPTION
7+
Performs tests on a module.
8+
9+
.EXAMPLE
10+
Get-NamedSectionTest -Name 'World'
11+
12+
"Hello, World!"
13+
#>
14+
[CmdletBinding()]
15+
param (
16+
# Name of the person to greet.
17+
[Parameter(Mandatory)]
18+
[string] $Name
19+
)
20+
Write-Output "Hello, $Name!"
21+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Named Section
2+
3+
This section's landing page is provided by a file named after its folder (`NamedSection.md`).
4+
5+
When Process-PSModule builds the documentation site, this page becomes the landing page for the **Named Section** group in the navigation on GitHub Pages.

tests/PSModuleTest.Tests.ps1

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,10 @@ Describe 'Module' {
2222
It 'Function: Test-PSModuleTest' {
2323
Test-PSModuleTest -Name 'World' | Should -Be 'Hello, World!'
2424
}
25+
It 'Function: Get-IndexSectionTest' {
26+
Get-IndexSectionTest -Name 'World' | Should -Be 'Hello, World!'
27+
}
28+
It 'Function: Get-NamedSectionTest' {
29+
Get-NamedSectionTest -Name 'World' | Should -Be 'Hello, World!'
30+
}
2531
}

0 commit comments

Comments
 (0)