-
Notifications
You must be signed in to change notification settings - Fork 4k
Remove all XML help #3655
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Remove all XML help #3655
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
1fcaf37
Remove ARM and Storage XML help
cormacpayne 8810c06
Refresh all markdown files based on content in repository
cormacpayne d2c1a4b
Replace reference to XML in csproj with reference to help folder
cormacpayne 6552818
Remove platyPSHelp module and documentation
cormacpayne acb0a49
Refresh wxi file
cormacpayne 17d0618
Add script and module to generate help, add exceptions file, and add …
cormacpayne 50d1885
Refactor HelpAnalyzer to search for markdown instead of XML file for …
cormacpayne 279f355
Revert changes made to wxi file, remove unnecessary references to dll…
cormacpayne b529e15
Update csproj files with correct path for copying to Debug and Release
cormacpayne 8f57a46
Generate/validate help for Debug and Release, fix issue with error no…
cormacpayne 0d1b624
Resolve review feedback
cormacpayne 5e46046
Run GenerateHelp script after StaticAnalysis
cormacpayne 5bd516f
Add CleanupBuild script to remove markdown files
cormacpayne 0a4c4b4
Merge branch 'preview' of https://github.com/Azure/azure-powershell i…
cormacpayne 39673ed
Update markdown files based on latest changes
cormacpayne ca99ffa
Update exceptions list and fix errors from wxi
cormacpayne 63f2a98
Update help for changed Profile cmdlets
cormacpayne d11c418
Merge branch 'preview' of https://github.com/Azure/azure-powershell i…
cormacpayne ce05522
Resolve code review feedback
cormacpayne d90a7f4
Add document for generating help
cormacpayne 0e1658d
Revert change in StaticAnalysis
cormacpayne 71b9c47
Merge branch 'preview' of https://github.com/Azure/azure-powershell i…
cormacpayne a24e6a6
Merge branch 'remove-xml-help' of https://github.com/cormacpayne/azur…
cormacpayne File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
# Azure PowerShell Help Generation | ||
|
||
## Description | ||
|
||
All MAML files containing the help content for cmdlets have been removed from the Azure PowerShell repository and replaced with markdown files, which are generated and maintained using the [`platyPS`](https://github.com/PowerShell/platyPS) module. Each module has a `help` folder (_e.g.,_ `src/ResourceManager/Profile/Commands.Profile/help`) which contains a markdown file for each of the cmdlets found in that given module. When the help content for a cmdlet (or multiple cmdlets) needs to be updated, users will now only have to update the contents of the markdown file, _and not the MAML file as well_. | ||
|
||
## Installing `platyPS` | ||
|
||
In order to use the cmdlets necessary to update the markdown help files (or generate MAML help locally from these markdown files), you must first install the `platyPS` module mentioned previously. | ||
|
||
To do so, you can can follow the below steps (which are outlined in the [**Quick start**](https://github.com/PowerShell/platyPS#quick-start) section of the `platyPS` README): | ||
|
||
```powershell | ||
Install-Module -Name platyPS -Scope CurrentUser | ||
Import-Module platyPS | ||
``` | ||
|
||
**Note:** this module will need to be installed from the [PowerShell Gallery](http://www.powershellgallery.com/). If, for some reason, this isn't a registered repository when running the `Get-PSRepository` cmdlet, then you will need to register it by running the following command: | ||
|
||
```powershell | ||
Register-PSRepository -Name PSGallery -SourceLocation https://www.powershellgallery.com/api/v2/ | ||
``` | ||
|
||
## Using `platyPS` | ||
|
||
### Importing your module | ||
|
||
Before you run the `platyPS` cmdlets to update your markdown help files, you will need to first import the module containing the changes that you have made to your cmdlets into your current PowerShell session. Once you have built your project (either through Visual Studio or with `msbuild`), you can locate the module manifest that you will need to import in the `src/Package/Debug` folder of your local repository. | ||
|
||
For example, if you have made changes to the `Profile` module, you will find the corresponding module manifest in `src/Package/Debug/ResourceManager/AzureResourceManager/AzureRM.Profile/AzureRM.Profile.psd1`. | ||
|
||
Once you have located the module manifest, you can import it in your current PowerShell session by running the following command: | ||
|
||
```powershell | ||
$PathToModuleManifest = "../../<module>.psd1" | ||
Import-Module -Name $PathToModuleManifest | ||
``` | ||
|
||
**Note**: if you do not see all of the changes you made to the cmdlets in your markdown files (_e.g.,_ a cmdlet you deleted is still appearing), you may need to delete any existing Azure PowerShell modules that you have on your machine (installed either through the PowerShell Gallery or by Web Platform Installer) before you import your module. | ||
|
||
### Updating help after making cmdlet changes | ||
|
||
Whenever the public interface for a cmdlet has changed, the corresponding markdown file for that cmdlet will need to be updated to reflect the changes. Public interface changes include the following: | ||
|
||
- Add/change/remove parameter set | ||
- Add/remove parameter | ||
- Change attribute of a parameter | ||
- Type | ||
- Parameter set(s) | ||
- Aliases | ||
- Mandatory | ||
- Position | ||
- Accept pipeline input | ||
- Add/change output type | ||
|
||
#### Updating all markdown files in a module | ||
|
||
To update all of the markdown files for a single module, use the [`Update-MarkdownHelpModule`](https://github.com/PowerShell/platyPS/blob/master/docs/Update-MarkdownHelpModule.md) cmdlet: | ||
|
||
```powershell | ||
$PathToModuleManifest = "../../<module.psd1" # Full path to the module manifest that you have updated | ||
Import-Module -Name $PathToModuleManifest | ||
|
||
$PathToHelpFolder = "../../help" # Full path to help folder containing markdown files to be updated | ||
Update-MarkdownHelpModule -Path $PathToHelpFolder -RefreshModulePage -AlphabeticParamsOrder | ||
``` | ||
|
||
This will update all of the markdown files with public interface changes made to corresponding cmdlets, add markdown files for any new cmdlets, remove markdown files for any deleted cmdlets, and update the module page (_e.g.,_ `AzureRM.Profile.md`) with any added or removed cmdlets. | ||
|
||
#### Updating a single markdown file | ||
|
||
To update a single markdown file with the changes made to the corresponding cmdlet, use the [`Update-MarkdownHelp`](https://github.com/PowerShell/platyPS/blob/master/docs/Update-MarkdownHelp.md) cmdlet: | ||
|
||
```powershell | ||
$PathToModuleManifest = "../../<module>.psd1" # Full path to the module manifest that you have updated | ||
Import-Module -Name $PathToModuleManifest | ||
|
||
$PathToMarkdownFile = "../../<cmdlet>.md" # Full path to the markdown file to be updated | ||
Update-MarkdownHelp -Path $PathToMarkdownFile -AlphabeticParamsOrder | ||
``` | ||
|
||
#### Generating and viewing the MAML help | ||
|
||
During the build, the MAML help will be generated from the markdown files in the repository. If you would like to generate the MAML help and preview what the help content will look like for each of your cmdlets, you can do so with two more commands. | ||
|
||
To generate the MAML help based on the contents of your markdown files, use the [`New-ExternalHelp`](https://github.com/PowerShell/platyPS/blob/master/docs/New-ExternalHelp.md) cmdlet: | ||
|
||
```powershell | ||
$PathToHelpFolder = "../../help" # Full path to help folder containing markdown files to be updated | ||
$PathToOutputFolder = "../../.." # Full path to folder where you want the MAML file to be generated | ||
New-ExternalHelp -Path $PathToHelpFolder -OutputPath $PathToOutputFolder | ||
``` | ||
|
||
To preview the help that you just generated, use the [`Get-HelpPreview`](https://github.com/PowerShell/platyPS/blob/master/docs/Get-HelpPreview.md) cmdlet: | ||
|
||
```powershell | ||
$PathToMAML = "../../<maml>.dll-Help.xml" # Full path to the MAML file that was generated | ||
|
||
# Save the help locally | ||
$help = Get-HelpPreview -Path $PathToMAML | ||
|
||
# Get the help for a specific cmdlet | ||
$help | where { $_.Name -eq "<cmdlet>" } | ||
``` |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make sure the build fails if this fails? We can do this by settign ContinueOnError="false", similar to this: https://github.com/Azure/azure-powershell/blob/stack-dev/build.proj#L369
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, lets make sure that building the installer always happens after generating help