8000 build updated documentation · ModuleBuild/ModuleBuild@33ff9c3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 33ff9c3

Browse files
committed
build updated documentation
1 parent 615327a commit 33ff9c3

20 files changed

+50
-44
lines changed

build/reports/0.3.0/CodeHealthReport-Private.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ <h1>
189189
<div class="col-sm-4 col-md-5 col-lg-4 right-header">
190190
<h5>
191191
Analyzed path :<span class="right-header-data"> src\private</span><br>
192-
Analysis date :<span class="right-header-data"> 2020-04-23 20:47:50Z</span>
192+
Analysis date :<span class="right-header-data"> 2020-04-23 21:15:21Z</span>
193193
</h5>
194194
</div>
195195
</div>

build/reports/0.3.0/CodeHealthReport-Public.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ <h1>
189189
<div class="col-sm-4 col-md-5 col-lg-4 right-header">
190190
<h5>
191191
Analyzed path :<span class="right-header-data"> src\public</span><br>
192-
Analysis date :<span class="right-header-data"> 2020-04-23 20:46:04Z</span>
192+
Analysis date :<span class="right-header-data"> 2020-04-23 21:13:41Z</span>
193193
</h5>
194194
</div>
195195
</div>

docs/Usage/10 - Converting To ModuleBuild.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ So in order to convert an existing project to a modulebuild project you will fol
2525
5. Add any required preload or postload code in src\other\preload.ps1 or src\other\postload.ps1
2626

2727
## Very Important Notes
28+
2829
- This will generally work well for easy projects. Modules with many dependencies or higher complexity levels will likely be more work to get converted.
2930
- It is very important that, when specifying your module source, that you choose the right file. There are BIG differences in behavior between importing a psm1 file and a psd1 file and whichever one you pass in will be the one that gets imported.
3031
- I'd only run these commands against a newly initialized project but you could theoretically use this to split up some monolithic module for development purposes. Conversely, you could also use these to merge the public/private functions of multiple disperate modules as well.
3132
- These helper functions are also to be used for migrating existing modulebuild projects to updated versions of modulebuild in the future. All you have to copy over from an existing modulebuild project after importing the private/public functions is the json configuration file, your preload/postload customizations, and additional paths.
32-
- If you tend to use your module project directories as dumping grounds for ideas and scratch code you may want to clean things up a bit before importing your private functions. Otherwise you could be in for a long process of yes/no prompts.
33+
- If you tend to use your module project directories as dumping grounds for ideas and scratch code you may want to clean things up a bit before importing your private functions. Otherwise you could be in for a long process of yes/no prompts.

docs/Usage/11 - Module Plugins.md

Lines changed: 1 addition & 0 deletions
Ori A3E2 ginal file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ As of version 0.1.7 template module plugins are supported. These are optional pl
55
Currently the following plugins are available:
66

77
## NLog
8+
89
This includes all the code needed to automatically log all of the following commands within your module:
910

1011
- Write-Host

docs/Usage/12 - Writing Pester tests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Writing Pester tests with ModuleBuild
22

3-
We wont go deep into how to write pester tests, just how they are integrated into ModuleBuild.
3+
We won't go deep into how to write pester tests, just how they are integrated into ModuleBuild.
44

55
ModuleBuild sorts Pester tests in 3 flavours. Meta, Unit and Intergration tests.
66

docs/Usage/3 - Build A Release.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ or in VS Code
1313
Press 'Ctrl+Shift+B' then select 'Build'
1414

1515
This is the heart of the ModuleBuild project. The build will go through the process of combining the source files into a monolithic psm1 file, populating the exportable functions of the release module manifest, creating online help files, analyze the script, scan for sensitive terms, and more. If everything builds without errors you will see the results populated in the release directory in two areas:
16+
1617
1. In the release directory in a folder with the same name as the module (which is best practice for a module)
1718
2. In the release directory in a folder with the version number of the release.
1819

@@ -23,4 +24,5 @@ At this point you should have a working release you could theoretically have som
2324
**Note:** *The build will pause if you didn't have enough comment based help to create the help file. Now is a chance to look at the created markdown files it references in the temp\docs directory to see what is missing. Use this as a chance to round back on your CBH in the source function files and update it to fill in the gaps. Then restart the build process again. Alternately, you can update the markdown files directly then continue the build process but this is NOT recommended as it is a temporary solution at best.*
2425

2526
## Pre and Post Build Steps
26-
If you have some things you need to do before or after your build simply drop ps1 scripts in to build\startup or build\cleanup (respectively) to have them run. This project uses build\startup\makeplastermanifest.ps1 to go through the custom plaster manifest build process for instance.
27+
28+
If you have some things you need to do before or after your build simply drop ps1 scripts in to build\startup or build\cleanup (respectively) to have them run. This project uses build\startup\MakePlasterManifest.ps1 to go through the custom plaster manifest build process for instance.

docs/Usage/4 - Test A Release.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Step 4 - Test a Release
2+
23
You may get a build to complete without errors but that doesn't mean that the module will behave as expected. You can do a quick module install and load test if you like:
34

45
`.\Build.ps1 -InstallAndTestModule`
@@ -18,4 +19,4 @@ or
1819

1920
or in VS Code
2021

21-
`Ctrl+Shift+B (then select "Build, Install, and Test Module")`
22+
`Ctrl+Shift+B (then select "Build, Install, and Load Module")`

docs/Usage/5 - Publish A Release.md

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
11
# Step 5 - Upload A PowerShell Gallery Release (Optional)
2-
If you have plans to upload your module to the PowerShell Gallery then this build script can help automate the process a bit. You will still need to create an account and attain an API key from the PowerShell Gallery [website](https://www.powershellgallery.com/).
3-
4-
Once you have attained your API key you will need to update your build configuration file with it. From witin your project root directory do the following:
5-
6-
`Set-MBTBuildEnvironment -NugetAPIKey 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'`
7-
8-
Now when you are ready to upload to the psgallery simply run the following:
9-
10-
`.\Build.ps1 -UploadPSGallery`
112

12-
Assuming you have a valid NugetAPI key defined and your PowerShell manifest file has everything the gallary requires then this build step will automatically update the the upload the recent release directory module to the PowerShell Gallery for you.
3+
If you have plans to upload your module to the PowerShell Gallery then this build script can help automate the process a bit. You will still need to create an account and attain an API key from the PowerShell Gallery [website](https://www.powershellgallery.com/).
134

14-
**Note:** *I've not figured out yet how to reset versions when uploading to the gallery. You always have to upload a newer version than what is already there so be extra certain you are ready to publish the module before doing this step.*
5+
Once you have attained your API key you will need to update your build configuration file with it. From witin your project root directory open the following file:
6+
`build\YourModuleName.buildenvironment.json`
157

16-
Hey, one more point, you can chain things together and do a build, install and test, and upload to the powershell gallery in one fell swoop:
8+
Here you are able to update the NugetAPIKey.
179

18-
`.\Build.ps1 -BuildModule -InstallAndTestModule -UploadPSGallery -ReleaseNotes 'First Upload'`
10+
```json
11+
...
12+
"FirstRun": false,
13+
"NugetAPIKey": "Add-Your-Key-Here",
14+
"OptionTranscriptLogFile": "BuildTranscript.Log",
15+
...
16+
```
1917

20-
or
18+
**Note:** *Don't add the NugetAPIKey to the `build\YourModuleName.buildenvironment.ps1` file. This file is NOT ignored by the included .gitignore.*
2119

22-
`Invoke-Build -Task BuildInstallTestAndPublishModule`
20+
Now when you are ready to upload to the PSGallery simply run the following:
2321

24-
or in VS Code
22+
`.\Build.ps1 -UploadPSGallery`
2523

26-
`Ctrl+Shift+B (then select "Build, Install, Test, and Publish Module")`
24+
Assuming you have a valid NugetAPI key defined and your PowerShell manifest file has everything the PSGallary requires then this build step will automatically update the the upload the recent release directory module to the PowerShell Gallery for you.
2725

28-
After this has completed the build version number will automatically be incremented by 1 and updated in your build configuration and the main module manifest file.
26+
**Note:** *I've not figured out yet how to reset versions when uploading to the gallery. You always have to upload a newer version than what is already there so be extra certain you are ready to publish the module before doing this step.*

docs/Usage/6 - Your Next Release.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,8 @@
22

33
To start working on your next release (or roll back to a prior release) you will need to update the version of your module. This is easily done:
44

5-
`.\Build.ps1 -NewVersion '0.0.5'`
5+
`.\Build.ps1 -UpdateRelease -NewVersion '0.0.5'`
66

77
Once this has been done you can proceed to build your module again:
88

99
`.\Build.ps1`
10-
11-
Oh, and if you have been paying attention up to this point you will have seen this coming. You can chain all this crap together into one command:
12-
13-
`.\Build.ps1 -NewVersion '0.0.5' -BuildModule -InstallAndTestModule -UploadPSGallery -ReleaseNotes '0.0.5 release'`
14-
15-
**Note:** It should be noted that performing the InstallAndTestModule build step is a bit superfluous as that gets done prior to uploading to the PSGallery as well. Also, you usually will be working on a release/build a bit before going straight to releasing to the gallery so I generally don't recommend doing everything in one fell swoop like this. You also get a much cleaner build experience if you simply use the invoke-build command to string the build steps together.

docs/Usage/7 - Project Documentation.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Maintaining Project Documentation
2+
23
Keeping documentation updated for your project comes in two forms with the module code scaffolding that this project creates.
34

45
1. You keep your comment based help for public functions updated. PlatyPS will use this to generate function documentation.
@@ -13,13 +14,14 @@ Your module documentation also comes in a few different forms and locations that
1314
>**NOTE:** If you get one thing from this section it is that you should **NOT** be updating your project documentation in the .\docs folder directly. Instead, use the build\docs folder to update your documentation and it will automatically populate to your project .\docs directory at build time.
1415
1516
## Comment Based Help (aka. CBH)
17+
1618
This build project assumes that the comment based help in your public functions are the single source of truth for your documentation.
1719

1820
ModuleBuild uses PlatyPS to generate the relevant help files at every build. The build will fail if "{{ blah blah blah }}" is found within the PlatyPS markdown output. PlatyPS puts this marker text in place when you have missed parameters, synopsis, descriptions, or other essential CBH sections.
1921

2022
It is possible to setup the build process in a manner that would allow us to manually make updates to the .md files and then continue processing. But I've purposefully decided against this so you are encouraged to go back to your original functions, fix/change the offending CBH, and rebuild.
2123

22-
Once PlatyPS autodocumentation is complete the CBH for each function gets replaced with the generated module documentation link. I base this replacement code on '.SYNOPSIS' existing in the comment based help. This is done in the following task:
24+
Once PlatyPS auto-documentation is complete the CBH for each function gets replaced with the generated module documentation link. I base this replacement code on '.SYNOPSIS' existing in the comment based help. This is done in the following task:
2325

2426
```powershell
2527
task UpdateCBH -Before CreateModulePSM1 {
@@ -38,21 +40,25 @@ As you might expect this will remove the entire CBH block which may or may not b
3840
>**NOTE:** ModuleBuild recreates the documentation markdown files every time the documentation gets generated. This includes the module landing page. PlatyPS doesn't seem to automatically pull in function description information (or I'm missing something in the usage of this module) so I do so within another task behind the scenes.
3941
4042
## CBH Helper
41-
I've included a special task called 'UpdateCBHToScratch' that will recurse through your public functions and look for those that don't have CBH and add it. These files get spit out to your scratch directory and can be inspected for possible reintegration into your project. You can run this process at anytime with the following switch:
4243

43-
`.\Build.ps1 -InsertCBH`
44+
I've included a special task called 'AddMissingCBH' that will search through your public functions and look for those that don't have CBH and add it. These files get spit out to your scratch directory and can be inspected for possible reintegration into your project. You can run this process at anytime with the following switch:
45+
46+
`.\Build.ps1 -AddMissingCBH`
4447

4548
If you have a large project with little CBH this can be a good way to kickstart the process so the build process will start working. Additionally, if you add a bunch of public functions without CBH you can use this process to fill things out temporarily until you have time to round back and add better details.
4649

4750
>**NOTE:** This process requires you to copy the resulting files back into your project to be of any use.
4851
4952
## Generic Documentation
53+
5054
Most of your documentation will come from two sources, the auto-generated function markdown that PlatyPS spits out and the build\docs\Additional folder.
5155

5256
## ReadTheDocs.org Integration
57+
5358
If you have enabled readthedocs.org integration in the ModuleBuild configuration then a mkdocs.yml file will get updated automatically at the root of your project directory. It is up to you to setup the integration between your github.com account and readthedocs.org for this to be of any use in your project. When setting up your project at the ReadTheDocs website remember to set the advanced settings for 'mkdocs' processing.
5459

5560
### ReadTheDocs YAML Configuration
61+
5662
The ReadTheDocs manifest file gets generated from three locations:
5763

5864
1. The folder structure in .\build\docs\ReadTheDocs - Each subfolder becomes a category with each markdown document within becoming a specific page within it.

0 commit comments

Comments
 (0)
0