docs: Document the docs/ schema conversion for consumers - #180
Merged
Merged
Conversation
Add a migration entry covering how a consumer converts a committed docs/ tree from the platyPS 0.14.x schema to the Microsoft.PowerShell.PlatyPS 1.x schema, plus a Quick Start bullet linking to it. The headline finding is that most consumers need no conversion step at all: the GenerateMarkdown task already runs Update-MarkdownCommandHelp over every existing command document, so an ordinary 1.0.0 build rewrites a 0.14.x tree in place. The entry reframes the work as reading the diff rather than running a one-shot, and documents the manual path for the cases where a build cannot do it. Every claim was verified against Microsoft.PowerShell.PlatyPS 1.0.3 using a throwaway module whose 0.14.x markdown was generated by platyPS 0.14.2 in a separate process, then hand-edited so content loss would be visible. Closes #154 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MuBy4d575f3TQf4c2FmVdA
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
docs/tree converts itself on the first build",telling consumers how to move a committed
docs/tree from the platyPS 0.14.x schema to theMicrosoft.PowerShell.PlatyPS 1.x schema, plus a Quick Start bullet linking to it.
#154placeholder in the "Generated markdown uses the PlatyPS 1.x schema"entry with a link to the new entry.
Closes #154
The headline finding
The issue framed this as "document the one-shot." Running it showed the one-shot is usually
unnecessary.
Build-PSBuildMarkdownalready callsUpdate-MarkdownCommandHelpover everyexisting command document on every build, and that cmdlet rewrites a 0.14.x document into the
1.x schema in place. A committed 0.14.x tree converts itself on the first 1.0.0 build,
landing page included:
So the entry reframes the work as reading the diff the build produces rather than running a
conversion, and keeps a manual path for the case where you want the conversion as its own
reviewable commit.
Where the snippet in the issue is wrong
The issue's proposed one-shot ends with
Export-MarkdownCommandHelp -OutputFolder .\docs\en-US -Force. Run verbatim against a real0.14.x tree, it does not convert anything in
docs/en-US.Export-MarkdownCommandHelpalways appends the module name to
-OutputFolder:It exits 0 and looks like it worked. This is the same nesting
Build-PSBuildMarkdownalreadyworks around with a staging directory. The entry documents
Update-MarkdownCommandHelpas thein-place one-shot instead, and calls out the export pipeline explicitly as a trap.
Verification method
A throwaway module (three functions, hand-written
.EXAMPLEand.NOTESin comment-basedhelp) in
$env:TEMP. Genuine 0.14.x markdown generated by platyPS 0.14.2; conversion rununder Microsoft.PowerShell.PlatyPS 1.0.3. Separate
pwsh -NoProfile -Fileprocesses foreach half — the two modules ship conflicting
YamlDotNetassemblies and cannot coexist in onesession. Before converting, the generated markdown was hand-edited with seven
HANDWRITTEN-*markers so content loss would be visible.
What was verified
Content survival
Hand-written examples and notes survive. A heading outside the PlatyPS schema (
## CAVEATS)is dropped with no warning and no error — that is the real content-loss hazard, and it is the
same in both the update and the export paths.
A new hazard the issue did not anticipate
An edited parameter description is appended to, not replaced, and it compounds on every
build. After one build:
After two:
Parameter descriptions that match comment-based help are unaffected. Documented with the fix
(make comment-based help the source of truth for parameter descriptions).
Front matter
external help file:is carried across byte for byte, so the 0.14.x lowercase<Module>-help.xmlspelling that PowerShellBuild pins survives and.ExternalHelpkeepsresolving on case-sensitive file systems.
ms.date:is added by the update path only, not bythe export path.
The
-NoBackuphazard (PowerShell/platyPS#863)Confirmed, and confirmed that
-NoBackupmakes it repeatable.The landing-page hazard (PowerShell/platyPS#862)
Confirmed for MAML — an unfiltered batch writes nothing at all:
The markdown path behaves differently, and the entry says so.
Update-MarkdownCommandHelprejects the landing page loudly (
'…\ScratchModule.md' is not a CommandHelp file.) andconverts the rest anyway. But
Import-MarkdownCommandHelpaccepts it silently, returns aCommandHelpobject titled after the module, andExport-MarkdownCommandHelpwrites it backas an empty cmdlet document with the landing page's
{{ Update Download Link }}placeholdersembedded as malformed YAML. Silent corruption rather than an abort.
The skip-without-
-ForcehazardConfirmed: warning only, nothing written, success returned.
Documents the build cannot convert
Update-MarkdownCommandHelpresolves each document's command in the current session. Withoutthe module imported it fails with a message that is only the command name:
Nothing is written and the file stays on 0.14.x. This is why an orphaned document — one for a
command the module no longer exports — never converts, and why
Measure-PlatyPSMarkdownreporting
V1Schemaafter a build is the detection step in the entry.Also verified:
Update-MarkdownModuleFilecannot refresh a landing page on its own — itrequires the
-CommandHelpobjects the page indexes (Cannot process command because of one or more missing mandatory parameters: CommandHelp.). The entry says to leave the page alone andlet the build replace it.
Test Plan
./build.ps1 -Task Test—Tests Passed: 471, Failed: 0, Skipped: 2(unchanged baseline).markdownlint.json— no trailing whitespace, no hard tabs, singletrailing newline; the only lines over 100 characters are unbreakable link lines,
matching the existing entries in the same file
Breaking Changes
None. Documentation only.
🤖 Generated with Claude Code
https://claude.ai/code/session_01MuBy4d575f3TQf4c2FmVdA