Skip to content

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 23 commits into from
Apr 25, 2017
Merged
Show file tree
Hide file tree
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 Mar 25, 2017
8810c06
Refresh all markdown files based on content in repository
cormacpayne Mar 25, 2017
d2c1a4b
Replace reference to XML in csproj with reference to help folder
cormacpayne Mar 25, 2017
6552818
Remove platyPSHelp module and documentation
cormacpayne Mar 25, 2017
acb0a49
Refresh wxi file
cormacpayne Mar 25, 2017
17d0618
Add script and module to generate help, add exceptions file, and add …
cormacpayne Mar 25, 2017
50d1885
Refactor HelpAnalyzer to search for markdown instead of XML file for …
cormacpayne Mar 28, 2017
279f355
Revert changes made to wxi file, remove unnecessary references to dll…
cormacpayne Mar 28, 2017
b529e15
Update csproj files with correct path for copying to Debug and Release
cormacpayne Mar 29, 2017
8f57a46
Generate/validate help for Debug and Release, fix issue with error no…
cormacpayne Mar 29, 2017
0d1b624
Resolve review feedback
cormacpayne Mar 30, 2017
5e46046
Run GenerateHelp script after StaticAnalysis
cormacpayne Mar 31, 2017
5bd516f
Add CleanupBuild script to remove markdown files
cormacpayne Mar 31, 2017
0a4c4b4
Merge branch 'preview' of https://github.com/Azure/azure-powershell i…
cormacpayne Apr 10, 2017
39673ed
Update markdown files based on latest changes
cormacpayne Apr 10, 2017
ca99ffa
Update exceptions list and fix errors from wxi
cormacpayne Apr 10, 2017
63f2a98
Update help for changed Profile cmdlets
cormacpayne Apr 13, 2017
d11c418
Merge branch 'preview' of https://github.com/Azure/azure-powershell i…
cormacpayne Apr 21, 2017
ce05522
Resolve code review feedback
cormacpayne Apr 21, 2017
d90a7f4
Add document for generating help
cormacpayne Apr 21, 2017
0e1658d
Revert change in StaticAnalysis
cormacpayne Apr 21, 2017
71b9c47
Merge branch 'preview' of https://github.com/Azure/azure-powershell i…
cormacpayne Apr 25, 2017
a24e6a6
Merge branch 'remove-xml-help' of https://github.com/cormacpayne/azur…
cormacpayne Apr 25, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 4 additions & 3 deletions build.proj
Original file line number Diff line number Diff line change
Expand Up @@ -184,16 +184,17 @@
Targets="Build"
Properties="Configuration=$(Configuration);Platform=Any CPU"
BuildInParallel="$(BuildInParallel)"
ContinueOnError="false" />

ContinueOnError="false" />

<Exec Command="$(PowerShellCommand) -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\GenerateHelp.ps1 -ValidateMarkdownHelp -GenerateMamlHelp -BuildConfig $(Configuration) &quot;" ContinueOnError="false"/>
<CallTarget Targets="BuildSetupTest"/>
<CallTarget Targets="CodeSignBinaries" Condition=" '$(CodeSign)' == 'true' " />
<CallTarget Targets="BuildSetup"/>
<CallTarget Targets="CodeSignInstaller"
Condition=" '$(CodeSign)' == 'true' and '$(Scope)' == 'all'" />

<Message Importance="high" Text="Running Static Analyser" />
<CallTarget targets="DependencyAnalysis" />
<Exec Command="$(PowerShellCommand) -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\CleanupBuild.ps1 -BuildConfig $(Configuration) &quot;"/>
Copy link
Member

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

Copy link
Member

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

</Target>

<!-- Do everything possible -->
Expand Down
104 changes: 104 additions & 0 deletions documentation/help-generation.md
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>" }
```
Loading