Skip to content

Commit

Permalink
Add sidebar layout task Generate_Wiki_Sidebar (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
johlju authored Jan 14, 2024
1 parent c4bda82 commit a989303
Show file tree
Hide file tree
Showing 32 changed files with 2,113 additions and 251 deletions.
30 changes: 27 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
generate the modules help files to support `Get-Help` for public commands.
This task is dependent on the task `Generate_Markdown_For_Public_Commands`
to have been run prior.
- Task `Clean_Markdown_Of_Public_Commands` which will remove metadata and
wrongly added parameters in the command markdown documentation.
- Private function `Remove-MarkdownMetadataBlock` that removes metadata from a
- Task `Clean_Markdown_Of_Public_Commands` which will edit the the command
markdown documentation. For example it will remove the `ProgressAction`
parameter that PlatyPS remove wrongly add (due to a bug).
- Task `Clean_Markdown_Metadata` which will remove the markdown metadata
block from the markdown documentation. The metadata block was used for
other tasks to know what type of content the markdown file contained.
- Task `Generate_Wiki_Sidebar` - This task will generate the GitHub Wiki
Repository sidebar based on the files present in the built documentation
folder (defaults to `./output/WikiOutput`).
- Public command `Remove-MarkdownMetadataBlock` that removes metadata from a
Markdown file.
- Public command `New-GitHubWikiSidebar` generate the GitHub Wiki
Repository sidebar based on the files present in the built documentation
folder (defaults to `./output/WikiOutput`).
- Private function `Remove-ParameterFromMarkdown` that removes a parameter
from a commands markdown documentation.
- Private function `Remove-EscapedMarkdownCode` that removes a escape sequences
Expand All @@ -42,6 +52,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- The built module is now removed from the session when initiating a new
build. The build pipeline is dogfooding functionality and leaving a
previous version imported in the session do not use new code.
- Task `Generate_Wiki_Content`
- Support passing metadata trough the build configuration file (`build.yaml`).
- `New-DscResourceWikiPage`
- A new parameter `Metadata` that takes a hashtable of metadata. See
comment-based help for the format of the hashtable.
- `New-DscClassResourceWikiPage`
- A new parameter `Metadata` that takes a hashtable of metadata. See
comment-based help for the format of the hashtable.
- `New-DscCompositeResourceWikiPage`
- A new parameter `Metadata` that takes a hashtable of metadata. See
comment-based help for the format of the hashtable.
- `New-DscMofResourceWikiPage`
- A new parameter `Metadata` that takes a hashtable of metadata. See
comment-based help for the format of the hashtable.

### Fixed

Expand Down
79 changes: 78 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ Below is an example how the build task can be used when a repository is
based on the [Sampler](https://github.com/gaelcolas/Sampler) project.

>[!NOTE] This task is meant to be run after the tasks
>`Generate_Markdown_For_Public_Commands` and `Generate_Wiki_Content`.
>`Generate_Markdown_For_Public_Commands` and `Generate_Wiki_Content`, but
>before the task `Clean_Markdown_Metadata`.

```yaml
BuildWorkflow:
Expand All @@ -101,6 +102,40 @@ BuildWorkflow:
- Publish_GitHub_Wiki_Content
```

### `Clean_Markdown_Metadata`

This build task runs the command `Remove-MarkdownMetadataBlock` on each markdown
file that is present in the folder provided by the parameter `DocOutputFolder`
(defaults to _./output/WikiContent_).

See the command `Remove-MarkdownMetadataBlock` for more information.

Below is an example how the build task can be used when a repository is
based on the [Sampler](https://github.com/gaelcolas/Sampler) project.

>[!NOTE] This task is meant to be run after all tasks that generate of modifies
>markdown.

```yaml
BuildWorkflow:
'.':
- build
build:
- Clean
- Build_Module_ModuleBuilder
- Build_NestedModules_ModuleBuilder
- Create_changelog_release_output
- Generate_Wiki_Content
- Generate_Markdown_For_Public_Commands
- Clean_Markdown_Metadata
publish:
- Publish_release_to_GitHub
- publish_module_to_gallery
- Publish_GitHub_Wiki_Content
```

### `Generate_Conceptual_Help`

This build task runs the command `New-DscResourcePowerShellHelp`.
Expand Down Expand Up @@ -302,6 +337,48 @@ BuildWorkflow:
- Generate_Wiki_Content
```

### `Generate_Wiki_Sidebar`

This build task runs the command `New-GitHubWikiSidebar` (PlatyPS command) that
will generate markdown for the module's public commands. See the command
`New-GitHubWikiSidebar` for more information.

It is possible to pass:

- `DocOutputFolder` (default is `./output/WikiContent`)
- `DebugTask` (default is `$true`)

They can be set either in parent scope, as an environment variable, or if
passed as a parameter to the build task.

Below is an example how the build task can be used when a repository is
based on the [Sampler](https://github.com/gaelcolas/Sampler) project.

>[!NOTE] This task is meant to be run after all the needed tasks that generate
> markdown documentation. It must be run before `Clean_Markdown_Metadata`.

```yaml
BuildWorkflow:
'.':
- build
build:
- Clean
- Build_Module_ModuleBuilder
- Build_NestedModules_ModuleBuilder
- Create_changelog_release_output
- Generate_Wiki_Content
- Generate_Markdown_For_Public_Commands
- Clean_Markdown_Of_Public_Commands
- Generate_Wiki_Sidebar
- Clean_Markdown_Metadata
publish:
- Publish_release_to_GitHub
- publish_module_to_gallery
- Publish_GitHub_Wiki_Content
```

### `Publish_GitHub_Wiki_Content`

This build task runs the command `Publish-WikiContent`. The task will only
Expand Down
Loading

0 comments on commit a989303

Please sign in to comment.