Skip to content

Commit 823267d

Browse files
📖 [Docs]: Document the public help-link requirement
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 28ae16f commit 823267d

5 files changed

Lines changed: 9 additions & 6 deletions

File tree

docs/content/guides/skipping-framework-tests.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function Get-ComplexData {
6262
This file intentionally skips only the FunctionCount framework test.
6363
6464
.LINK
65-
https://psmodule.io/<ModuleName>/Functions/Get-ComplexData
65+
https://<DocumentationHost>/<ModuleName>/Functions/Get-ComplexData
6666
#>
6767
[OutputType([PSCustomObject])]
6868
[CmdletBinding()]
@@ -104,7 +104,7 @@ function Get-RawData {
104104
This function is a private helper for Get-ComplexData.
105105
106106
.LINK
107-
https://psmodule.io/<ModuleName>/Functions/Get-ComplexData
107+
https://<DocumentationHost>/<ModuleName>/Functions/Get-ComplexData
108108
#>
109109
[OutputType([string])]
110110
[CmdletBinding()]
@@ -145,7 +145,7 @@ function Format-ComplexData {
145145
This function is a private helper for Get-ComplexData.
146146
147147
.LINK
148-
https://psmodule.io/<ModuleName>/Functions/Get-ComplexData
148+
https://<DocumentationHost>/<ModuleName>/Functions/Get-ComplexData
149149
#>
150150
[OutputType([PSCustomObject])]
151151
[CmdletBinding()]
@@ -163,7 +163,7 @@ function Format-ComplexData {
163163
}
164164
```
165165

166-
Replace `<ModuleName>` with the module's published name. If the public function belongs to a group, insert `<Group>/` between `Functions/` and `Get-ComplexData`.
166+
Replace `<DocumentationHost>` with the HTTPS host that publishes the module documentation and `<ModuleName>` with the module's published name. If the public function belongs to a group, insert `<Group>/` between `Functions/` and `Get-ComplexData`.
167167

168168
The skip exempts only `FunctionCount`. Every function in the file must still follow the [PowerShell function standard](https://msx.no/docs/Coding-Standards/PowerShell/Functions/), including complete comment-based help, matching `[OutputType()]` and `.OUTPUTS` metadata, typed parameters, and implicit output.
169169

docs/content/guides/structuring-your-module.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ Key expectations:
6767
- A group's overview page (`<Category>/<Category>.md` named after the folder, or `<Category>/index.md`) becomes that group's section landing page in the docs navigation.
6868
- The build step compiles `src/` into a root module file and removes the original project layout from the artifact.
6969
- Documentation generation mirrors the `src/functions/public` hierarchy so help content always aligns with source.
70-
- Put the canonical public help URL first in each public command's comment-based help. For a command at `src/functions/public/<Group>/<Name>.ps1`, use `https://psmodule.io/<ModuleName>/Functions/<Group>/<Name>/`. `Test-PSModule` enforces this as `PublicHelpLink`; additional `.LINK` entries may follow.
70+
- Put the canonical public help URL first in each public command's comment-based help. For a command at `src/functions/public/<Group>/<Name>.ps1`, use `https://<DocumentationHost>/<ModuleName>/Functions/<Group>/<Name>/` with the HTTPS host that publishes the module documentation. `Test-PSModule` enforces this as `PublicHelpLink`; additional `.LINK` entries may follow.
7171
- Point each private helper's `.LINK` entry to the public command it supports, using that command's canonical grouped URL.
7272

7373
### Grouping and published help URLs
7474

75-
Process-PSModule generates command help and publishes each page to mirror the relative path under `src/functions/public/`. Moving an existing command into a group therefore changes its published URL from `https://psmodule.io/<ModuleName>/Functions/<Name>/` to `https://psmodule.io/<ModuleName>/Functions/<Group>/<Name>/`.
75+
Process-PSModule generates command help and publishes each page to mirror the relative path under `src/functions/public/`. Moving an existing command into a group therefore changes its published URL from `https://<DocumentationHost>/<ModuleName>/Functions/<Name>/` to `https://<DocumentationHost>/<ModuleName>/Functions/<Group>/<Name>/`.
7676

7777
When regrouping a command, update its first public `.LINK`, every private-helper `.LINK` that points to it, and any other references to the old URL in the same change. Process-PSModule does not create redirects for the old path; arrange a redirect separately in the publishing layer when existing links must continue to work.
7878

docs/content/guides/validating-before-review.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Do not repeat the shared workflow here. Follow the shared branch → draft PR
5555

5656
- comment-based help is present for every changed function, including private helpers
5757
- help sections, examples, `.INPUTS`, `.OUTPUTS`, and parameter documentation match the function contract from [MSX PowerShell Functions](https://msx.no/docs/Coding-Standards/PowerShell/Functions/)
58+
- every public function has a first `.LINK` entry using an absolute HTTPS URL whose path matches the generated command documentation path
5859
- public-function links and usage examples are current enough that generated documentation will stay accurate
5960

6061
Do not treat help as optional cleanup. In PSModule repositories, the function help is part of the delivered behavior.

docs/content/reference/framework-test-ids.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Run by the [Test source code](pipeline-stages.md#test-source-code) job against f
2626
| `CmdletBinding` | Functions (Generic) | Functions should include the `[CmdletBinding()]` attribute. | `#SkipTest:CmdletBinding:Simple helper function` |
2727
| `ParamBlock` | Functions (Generic) | Functions should have a parameter block (`param()`). | `#SkipTest:ParamBlock:No parameters needed` |
2828
| `FunctionTest` | Functions (Public) | All public functions and filters should have corresponding tests. | `#SkipTest:FunctionTest:Test in development` |
29+
| `PublicHelpLink` | Functions (Public) | Every public function and filter should have a first `.LINK` entry with an absolute HTTPS URL whose path matches its generated command documentation path. | `#SkipTest:PublicHelpLink:Legacy documentation link` |
2930

3031
## Module tests
3132

docs/content/reference/powershell-module-standard.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,7 @@ The CI pipeline automatically tests every source file against the following rule
358358
| `CmdletBinding` | Every function must have `[CmdletBinding()]` |
359359
| `ParamBlock` | Every function must have a `param()` block |
360360
| `FunctionTest` | Every public function must be referenced by the tests; its behavior must be covered whether the suite is per-command or grouped |
361+
| `PublicHelpLink` | Every public function must have a first `.LINK` entry with an absolute HTTPS URL whose path is `/Module/Functions/<relative-command>/` |
361362

362363
To skip a specific rule for one file only, add a comment at the very top of that file:
363364

0 commit comments

Comments
 (0)