|
1 |
| -[](https://ci.appveyor.com/project/PowerShell/markdown-maml/branch/master) |
2 |
| -[](https://travis-ci.org/PowerShell/platyPS/builds) |
3 |
| - |
4 |
| -[](https://gitter.im/PowerShell/platyPS?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) |
5 |
| - |
6 | 1 | # PlatyPS
|
7 | 2 |
|
8 | 3 | PlatyPS provides a way to:
|
9 | 4 |
|
10 |
| -* Write PowerShell External Help in Markdown |
11 |
| -* Generate markdown help ([example](docs/Update-MarkdownHelp.md)) for your existing modules |
12 |
| -* Keep markdown help up-to-date with your code |
| 5 | +- Write PowerShell External Help in Markdown |
| 6 | +- Generate markdown help |
| 7 | +- Keep markdown help up-to-date with your code |
| 8 | +- Create updateable help files |
13 | 9 |
|
14 |
| -Markdown help docs can be generated from old external help files (also known as MAML-xml help), the command objects (reflection), or both. |
15 |
| - |
16 |
| -PlatyPS can also generate cab files for [`Update-Help`](https://technet.microsoft.com/en-us/library/hh849720.aspx). |
| 10 | +Markdown help docs can be generated from old external help files (also known as MAML-xml help), the |
| 11 | +command objects (reflection), or both. |
17 | 12 |
|
18 | 13 | ## Why?
|
19 | 14 |
|
20 |
| -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. |
21 |
| -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. |
| 15 | +Traditionally PowerShell external help files have been authored by hand or using complex tool chains |
| 16 | +and rendered as MAML XML for use as console help. MAML is cumbersome to edit by hand, and common |
| 17 | +tools and editors don't support it for complex scenarios like they do with Markdown. PlatyPS is |
| 18 | +provided as a solution for allow documenting PowerShell help in any editor or tool that supports |
| 19 | +Markdown. |
22 | 20 |
|
23 |
| -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. |
| 21 | +An additional challenge PlatyPS tackles, is to handle PowerShell documentation for complex scenarios |
| 22 | +(e.g. very large, closed source, and/or C#/binary modules) where it may be desirable to have |
| 23 | +documentation abstracted away from the codebase. PlatyPS doesn't need source access to generate |
| 24 | +documentation. |
24 | 25 |
|
25 |
| -Markdown is designed to be human-readable, without rendering. This makes writing and editing easy and efficient. |
26 |
| -Many editors support it ([Visual Studio Code](https://code.visualstudio.com/), [Sublime Text](http://www.sublimetext.com/), etc), and many tools and collaboration platforms (GitHub, Visual Studio Online) render the Markdown nicely. |
| 26 | +Markdown is designed to be human-readable, without rendering. This makes writing and editing easy |
| 27 | +and efficient. Many editors support it, including [Visual Studio Code][04], and many tools and |
| 28 | +collaboration platforms (GitHub, Visual Studio Online) render the Markdown nicely. |
27 | 29 |
|
28 | 30 | ## Common setups
|
29 | 31 |
|
30 | 32 | There are 2 common setups that are used:
|
31 | 33 |
|
32 | 34 | 1. Use markdown as the source of truth and remove other types of help.
|
33 |
| -2. Keep comment based help as the source of truth and periodically generate markdown for web-site publishing. |
| 35 | +1. Keep comment based help as the source of truth and periodically generate markdown for web-site |
| 36 | + publishing. |
34 | 37 |
|
35 |
| -They both have advantages and use-cases, you should decide what's right for you. |
36 |
| -There is slight preference toward number 1 (markdown as the source). |
| 38 | +They both have advantages and use-cases, you should decide what's right for you. There is slight |
| 39 | +preference toward number 1 (markdown as the source). |
37 | 40 |
|
38 | 41 | ## Quick start
|
39 | 42 |
|
40 |
| -* Install platyPS module from the [PowerShell Gallery](https://www.powershellgallery.com/packages/platyPS): |
| 43 | +- Install platyPS module from the [PowerShell Gallery][07]: |
41 | 44 |
|
42 | 45 | ```powershell
|
43 | 46 | Install-Module -Name platyPS -Scope CurrentUser
|
44 | 47 | Import-Module platyPS
|
45 | 48 | ```
|
46 | 49 |
|
47 |
| -* Create initial Markdown help for `MyAwesomeModule` module: |
| 50 | +- Create initial Markdown help for `MyAwesomeModule` module: |
48 | 51 |
|
49 | 52 | ```powershell
|
50 | 53 | # you should have module imported in the session
|
51 | 54 | Import-Module MyAwesomeModule
|
52 | 55 | New-MarkdownHelp -Module MyAwesomeModule -OutputFolder .\docs
|
53 | 56 | ```
|
54 | 57 |
|
55 |
| -* Edit markdown files in `.\docs` folder and populate `{{ ... }}` placeholders with missed help content. |
| 58 | +- Edit markdown files in `.\docs` folder and populate `{{ ... }}` placeholders with missed help content. |
| 59 | +- Create external help from markdown help |
56 | 60 |
|
57 |
| -* Create external help from markdown help |
| 61 | + ```powershell |
| 62 | + New-ExternalHelp .\docs -OutputPath en-US\ |
| 63 | + ``` |
58 | 64 |
|
59 |
| -```powershell |
60 |
| -New-ExternalHelp .\docs -OutputPath en-US\ |
61 |
| -``` |
62 |
| - |
63 |
| -* **Congratulations**, your help is now in markdown! |
| 65 | + **Congratulations**, your help is now in markdown! |
64 | 66 |
|
65 |
| -* Now, if your module code changes, you can easily update your markdown help with |
| 67 | +- Now, if your module code changes, you can easily update your markdown help with |
66 | 68 |
|
67 |
| -```powershell |
68 |
| -# re-import your module with latest changes |
69 |
| -Import-Module MyAwesomeModule -Force |
70 |
| -Update-MarkdownHelp .\docs |
71 |
| -``` |
| 69 | + ```powershell |
| 70 | + # re-import your module with latest changes |
| 71 | + Import-Module MyAwesomeModule -Force |
| 72 | + Update-MarkdownHelp .\docs |
| 73 | + ``` |
72 | 74 |
|
73 | 75 | ### PlatyPS markdown schema
|
74 | 76 |
|
75 |
| -Unfortunately, you cannot just write any Markdown, as platyPS expects Markdown to be authored in a **particular way**. |
76 |
| -We have defined a [**schema**](platyPS.schema.md) to determine how parameters are described, where scripts examples are shown, and so on. |
| 77 | +Unfortunately, you cannot just write any Markdown, as platyPS expects Markdown to be authored in a |
| 78 | +**particular way**. We have defined a [**schema**][03] to determine how parameters are described, |
| 79 | +where scripts examples are shown, and so on. |
77 | 80 |
|
78 |
| -The schema closely resembles the existing output format of the `Get-Help` cmdlet in PowerShell. |
| 81 | +The schema closely resembles the existing output format of the `Get-Help` cmdlet in PowerShell. |
79 | 82 |
|
80 |
| -If you break the schema in your markdown, you will get error messages from `New-ExternalHelp` and `Update-MarkdownHelp`. |
81 |
| -You would not be able to generate extrenal help or update your markdown. |
| 83 | +If you break the schema in your markdown, you will get error messages from `New-ExternalHelp` and |
| 84 | +`Update-MarkdownHelp`. You would not be able to generate extrenal help or update your markdown. |
82 | 85 |
|
83 | 86 | It may be fine for some scenarios, i.e. you want to have online-only version of markdown.
|
84 | 87 |
|
85 |
| -## [Usage](docs) |
| 88 | +## [Usage][06] |
86 | 89 |
|
87 | 90 | Supported scenarios:
|
88 | 91 |
|
89 |
| -* Create Markdown |
90 |
| - * Using existing external help files (MAML schema, XML). |
91 |
| - * Using reflection |
92 |
| - * Using reflection and existing internal external help files. |
93 |
| - * For a single cmdlet |
94 |
| - * For an entire module |
95 |
| - |
96 |
| -* Update existing Markdown through reflection. |
97 |
| - |
98 |
| -* Create a module page <ModuleName>.md with summary. It will also allow you to create updatable help cab. |
99 |
| - |
100 |
| -* Retrieve markdown metadata from markdown file. |
101 |
| - |
102 |
| -* Create external help xml files (MAML) from platyPS Markdown. |
103 |
| - |
104 |
| -* Create external help file cab |
105 |
| - |
106 |
| -* Preview help from generated maml file. |
| 92 | +- Create Markdown |
| 93 | + - Using existing external help files (MAML schema, XML). |
| 94 | + - Using reflection |
| 95 | + - Using reflection and existing internal external help files. |
| 96 | + - For a single cmdlet |
| 97 | + - For an entire module |
| 98 | +- Update existing Markdown through reflection. |
| 99 | +- Create a module page `<ModuleName>.md` with summary. It will also allow you to create updatable |
| 100 | + help cab. |
| 101 | +- Retrieve markdown metadata from markdown file. |
| 102 | +- Create external help xml files (MAML) from platyPS Markdown. |
| 103 | +- Create external help file cab |
| 104 | +- Preview help from generated maml file. |
107 | 105 |
|
108 | 106 | ## Remoting
|
109 | 107 |
|
110 |
| -PlatyPS supports working with [`Import-PSSession`](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/import-pssession?view=powershell-6) aka implicit remoting. |
111 |
| -Just pass `-Session $Session` parameter to the platyPS cmdlets and it will do the rest. |
| 108 | +PlatyPS supports working with [Import-PSSession][05] aka implicit remoting. Just pass |
| 109 | +`-Session $Session` parameter to the platyPS cmdlets and it will do the rest. |
112 | 110 |
|
113 | 111 | ## Build
|
114 | 112 |
|
115 |
| -For information about building from sources and contributing see [contributing guidelines](CONTRIBUTING.md). |
| 113 | +For information about building from sources and contributing see [contributing guidelines][02]. |
116 | 114 |
|
117 | 115 | ## Code of Conduct
|
118 | 116 |
|
119 |
| -Please see our [Code of Conduct](CODE_OF_CONDUCT.md) before participating in this project. |
| 117 | +Please see our [Code of Conduct][01] before participating in this project. |
120 | 118 |
|
121 | 119 | ## Security Policy
|
122 | 120 |
|
123 |
| -For any security issues, please see our [Security Policy](SECURITY.md). |
| 121 | +For any security issues, please see our [Security Policy][08]. |
| 122 | + |
| 123 | +<!-- link references --> |
| 124 | +[01]: CODE_OF_CONDUCT.md |
| 125 | +[02]: docs/developer/platyPS/CONTRIBUTING.md |
| 126 | +[03]: docs/deveopler/platyPS.schema.md |
| 127 | +[04]: https://code.visualstudio.com/ |
| 128 | +[05]: https://docs.microsoft.com/powershell/module/microsoft.powershell.utility/import-pssession |
| 129 | +[06]: https://learn.microsoft.com/powershell/module/platyps/ |
| 130 | +[07]: https://www.powershellgallery.com/packages/platyPS |
| 131 | +[08]: SECURITY.md |
0 commit comments