A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/joshooaj/platyPS below:

joshooaj/platyPS: Write PowerShell External Help in Markdown

This repo is a fork of the official PlatyPS repo where I have updated the module to suit my needs. Once PlatyPS v1 is released with support for PowerShell 7.4 and a whole bunch of other improvements, I will be abandoning this repo in favor of the new and improved PlatyPS.

PlatyPS provides a way to:

Markdown help docs can be generated from old external help files (also known as MAML-xml help), the command objects (reflection), or both.

PlatyPS can also generate cab files for Update-Help.

Traditionally PowerShell external help files have been authored by hand or using complex tool chains and rendered as MAML XML for use as console help. MAML is cumbersome to edit by hand, and common tools and editors don't support it for complex scenarios like they do with Markdown. PlatyPS is provided as a solution for allow documenting PowerShell help in any editor or tool that supports Markdown.

An additional challenge PlatyPS tackles, is to handle PowerShell documentation for complex scenarios (e.g. very large, closed source, and/or C#/binary modules) where it may be desirable to have documentation abstracted away from the codebase. PlatyPS does not need source access to generate documentation.

Markdown is designed to be human-readable, without rendering. This makes writing and editing easy and efficient. Many editors support it (Visual Studio Code, Sublime Text, etc), and many tools and collaboration platforms (GitHub, Visual Studio Online) render the Markdown nicely.

There are 2 common setups that are used:

  1. Use markdown as the source of truth and remove other types of help.
  2. Keep comment based help as the source of truth and periodically generate markdown for web-site publishing.

They both have advantages and use-cases, you should decide what's right for you. There is slight preference toward number 1 (markdown as the source).

Install-Module -Name joshooaj.platyPS -Scope CurrentUser
Import-Module joshooaj.platyPS
# you should have module imported in the session
Import-Module MyAwesomeModule
New-MarkdownHelp -Module MyAwesomeModule -OutputFolder .\docs
New-ExternalHelp .\docs -OutputPath en-US\
# re-import your module with latest changes
Import-Module MyAwesomeModule -Force
Update-MarkdownHelp .\docs

Unfortunately, you cannot just write any Markdown, as platyPS expects Markdown to be authored in a particular way. We have defined a schema to determine how parameters are described, where scripts examples are shown, and so on.

The schema closely resembles the existing output format of the Get-Help cmdlet in PowerShell.

If you break the schema in your markdown, you will get error messages from New-ExternalHelp and Update-MarkdownHelp. You would not be able to generate extrenal help or update your markdown.

It may be fine for some scenarios, i.e. you want to have online-only version of markdown.

Supported scenarios:

PlatyPS supports working with Import-PSSession aka implicit remoting. Just pass -Session $Session parameter to the platyPS cmdlets and it will do the rest.

For information about building from sources and contributing see contributing guidelines.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4