Skip to content

Commit

Permalink
Updates Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Hunt committed Jan 5, 2024
1 parent e3cfe0c commit 63cd49f
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 182 deletions.
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## v0.2

- Adds `json` support

## v0.1

- [6c12e8d](https://github.com/cdhunt/potel/commit/6c12e8d6dcce2c44b1c70232268217794dd89696) Adds test for [httpunitPS](https://github.com/cdhunt/httpunitPS) configs and fixes related issues
Expand Down
27 changes: 14 additions & 13 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -195,24 +195,25 @@ function Publish {
function Docs {
param ()

Import-Module C:\source\Build-Docs\publish\Build-Docs\
Import-Module $publish -Force

$commands = Get-Command -Module $module
$HelpToMd = [System.IO.Path]::Combine($src, 'internal', 'Export-HelpToMd.ps1')
. $HelpToMd
$help = Get-HelpModuleData $module

@('# Import-ConfigData', [System.Environment]::NewLine) | Set-Content -Path "$docs/README.md"
$($manifest.Description) | Add-Content -Path "$docs/README.md"
@('## Cmdlets', [System.Environment]::NewLine) | Add-Content -Path "$docs/README.md"
# docs/README.md
$help | New-HelpDoc |
Add-ModuleProperty Name -H1 |
Add-ModuleProperty Description |
Add-HelpDocText "Commands" -H2 |
Add-ModuleCommands -AsLinks |
Out-HelpDoc -Path 'docs/README.md'

foreach ($command in $Commands | Sort-Object -Property Verb) {
# Individual Commands
foreach ($command in $help.Commands) {
$name = $command.Name
$docPath = Join-Path -Path $docs -ChildPath "$name.md"
$help = Get-Help -Name $name

Export-HelpToMd $help | Set-Content -Path $docPath

"- [$name]($name.md) $($help.Synopsis)" | Add-Content -Path "$docs/README.md"
$doc = New-HelpDoc -HelpModuleData $help
$doc.Text = $command.ToMD()
$doc | Out-HelpDoc -Path "docs/$name.md"
}

ChangeLog | Set-Content -Path "$parent/Changelog.md"
Expand Down
20 changes: 2 additions & 18 deletions docs/Import-ConfigData.md
Original file line number Diff line number Diff line change
@@ -1,61 +1,45 @@
# Import-ConfigData


Load configuration data from multiple file types. The returned object should look the same regardless of the source format.
## Parameters

## Parameters

### Parameter Set 1


- `[String]` **Path** _Specifies a path to a configuration file with an extention of psd1, toml, yaml, or yml._ Mandatory, ValueFromPipeline

- `[String]` **Path** _Specifies a path to a configuration file with an extention of psd1, toml, yaml, or yml._ Mandatory, ValueFromPipeline

## Examples


### Example 1


Return an object representing the contents of a PowerShell Data File.


```powershell
$config = Import-ConfigData -Path config.psd1
$config.DriveName
data
```


### Example 2


Return an object representing the contents of a TOML File.


```powershell
$config = Import-ConfigData -Path config.toml
$config.DriveName
data
```


### Example 3


Return an object representing the contents of a YAML File.


```powershell
$config = Import-ConfigData -Path config.yaml
$config.DriveName
data
```


## Links


- [https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_data_files?view=powershell-7.4](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_data_files?view=powershell-7.4)
- [https://toml.io/](https://toml.io/)
- [https://yaml.org/](https://yaml.org/)
Expand Down
6 changes: 3 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Import-ConfigData


Load configuration data from multiple file types.
## Cmdlets

## Commands

- [Import-ConfigData](Import-ConfigData.md) _Load configuration data from multiple file types._

- [Import-ConfigData](Import-ConfigData.md) Load configuration data from multiple file types.
148 changes: 0 additions & 148 deletions src/internal/Export-HelpToMd.ps1

This file was deleted.

0 comments on commit 63cd49f

Please sign in to comment.