-
-
Notifications
You must be signed in to change notification settings - Fork 475
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move help to PlatyPS and generate pages of wiki based on it too #720
Comments
The related issue #648 The current state of help - after merging currently opened pull requests. |
So ... if we think we want to do this, I think we should ... Just Do It!New-MarkdownHelp -Module Pester -OutputFolder Docs -WithModulePage And then ask people to start helping us fix them. |
Would be great to see pester help in platyPS. Let me know if you find anything blocking transition. |
Next step, clearly -- get people to help write help ;-) |
The related issue #555 |
The related issue: Would you like to include API documentation to your build?. |
The related series of blog posts Automated Documentation in a CI/CD Pipeline for PowerShell Modules with PlatyPS, psake, AppVeyor, GitHub and ReadTheDocs by @markekraus |
Anyone interested in implementing this or should we keep it as is and close it? |
I'll try to do that.
The related issue
PowerShell/platyPS#371
Wojciech Sciesinski
…________________________________
From: Jakub Jareš <[email protected]>
Sent: Sunday, December 16, 2018 2:40:26 PM
To: pester/Pester
Cc: Wojciech Sciesinski; Comment
Subject: Re: [pester/Pester] Move help to PlatyPS and generate pages of wiki based on it too (#720)
Anyone interested in implementing this or should we keep it as is and close it?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#720 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AErstcBBQFadi3P-AftZviKUJbAyWe_Jks5u5ltagaJpZM4LyVVn>.
|
halbarad (discord) APP [1:04 PM] #.ExternalHelp VMConfig-help.xml
Function Start-VmcLab { There's another way using an attribute on the function but I always forget what it is. New-ExternalHelp -Path $(Build.SourcesDirectory)\Docs -OutputPath `
$(Build.SourcesDirectory)\Output\en |
I actually generate Docs folder for all my projects:
I've not played with XML yet as I don't really know how to host XML online for a module and how to pinpoint it to the module. @nohwnd what you mentioned on twitter would be cool because right now it seems PlatyPS can take markdown help written inside a function (but not everything at least to my testing) and move it to docs folder, but having it work another way around would be great too. |
The problem I am trying to solve is how to keep the documentation up to date, trackable and easy to update. These days I am working on Pester v5 and I am removing and renaming a lot of stuff. Migrating from v4 to v5 will take some until we can safely retire v4, so having two versions of wiki is definitely needed. And the other thing is that scrolling past inline help is extremely annoying, especially since there are many functions in one file it's not very easy to see in which function I currently am. On the other hand I like that the wiki is easy to edit. @it-praktyk how far are you with this?:) |
Would it be enough to have the format of the documentation based on the CBH and from that generate either External-Help and Wiki pages? |
The functions I showed you will first create docs and then you use just https://github.com/EvotecIT/PSWinReporting/tree/master/Docs Any time you make an update, rerun the function and it will add missing files, parameters and generally fix it. What it doesn't do is update it back within the function so you would have to copy manually back, or have some kind of script that I've not found other way to do that. |
@fourpastmidnight If you could share what you have already, it would make it easier for us to skip in making it happen. |
So here is a move-help-to-platyps branch if more people want to work on this. The help should be in Markdown, and the comment based help would be generated from it. I would start with moving the help into it's own files, and then we can start talking about possibly making the wiki and the help using the same sources, or integrating in some way. Any takers? |
I'll make an initial work just now :-) |
Done, PR #1226. |
@it-praktyk k merged, only scrolled through the changes, and the first file looked broken, some extra type escaping there and incorrect code regions, but I will review properly when this is ready to merge to master. |
Done. 48c7379 |
|
@nohwnd, Some (all?) of changes will be reverted under the next update made by using Update-MarkdownHelp - please read the thread PowerShell/platyPS#345. |
@it-praktyk I am probably getting this wrong, but I thought that new-markdown help generates the markdown files from the existing files once. And then we use something different to convert the existing markdown files back to the powershell help. So formatting the markdown properly should not be a problem, because we will be using the markdown as the source of the help for the cmdlets, and not the other way around, in other words the markdown will never be regenerated again. Or that is not how it works? |
IMHO, Update-MarkdownHelp workflow is like below.
@vors, Am I right? The related issue: PowerShell/platyPS#393 |
You need to continue using Update-MarkdownHelp if you want to have all the benefits of it. Otherwise everytime you will change order, add parameters you will have to update docs manually. It's best to keep to the specs that platyPS proposes. |
Okay gotcha, I confused New-MarkdownHelp with Update-MarkdownHelp |
We can always help and bring new features to PlatyPS 👍 I'm sure @vors will be happy! |
Sorry I didn't reply yet, things have been crazy at work. I did take the option of not using The one major reason I did that, though, was to eliminate comment based help in the code which took up too much space. And, I'd still need to update comment based help, then update markdown help, then reformat the generated markdown anyway...too much work. I figured manually updating the markdown was going to be no more effort in most cases. Plus, I was unsure how platyPS would handle multiline code examples since, in comment based help, that is not possible anyway but is often something you need (should do) for clarity; however, this is possible when updating the help files directly instead of always regretting them from comment based help. Anyway, that's my $0.02... |
@nohwnd so yes, that implies you can generate the help once and then use the markdown as the primary source from which to generate help for the build. When I get into the office in about one hour, I'll quick dig up the psake task I'm using to do just that. |
Here is generated content by New / Update https://github.com/EvotecIT/PSEventViewer/blob/master/Docs/Get-EventsInformation.md As you can see there are several examples. It actually converted the content from https://github.com/EvotecIT/PSEventViewer/blob/master/Public/Get-EventsInformation.ps1 including comments under examples. Seems good enough right? |
@PrzemyslawKlys Hmm, I recalled having difficulty with that--but glad to see it seems to be working. Though, the example you linked to didn't have code + text. I think it's that interplay between code/non-code text that may trip up platyPS? I don't really remember. Here's my psake task for generating help, which probably already looks very much like what you're already doing: Task GenerateModuleHelp {
[string[]]$helpDocs = @(Get-ChildItem $DocsDirectory -File -Filter "*.md" -Recurse | Select-Object -ExpandProperty FullName)
New-ExternalHelp -Path $helpDocs -OutputPath "${ENV:BHPSModulePath}\en-US"
} I'm also using the BuildHelpers module which simplifies things for me--that's all those So, I first ran whatever cmdlet to run to convert my existing comment-based help to Markdown, tweaked the markdown, and now I only use |
I believe it takes everything under .Example as code you can see that in my example |
And actually, if you modify the output .md file as I did now it doesn't change it back. https://github.com/EvotecIT/PSEventViewer/blob/master/Docs/Get-EventsInformation.md So I would say as long as you conform to some rules you should be fine. |
Just to make it clear. I am using Update-MarkdownHelpModule not Update-MarkdownHelp which has different behavior. |
Oh, hmm, I'll have to read up on that. Thanks for the info! |
Question, though: Are we, in the end, going to remove the comment-based help from the |
As you say. Help in markdown only. |
I need help to find why some tests fail in the branch
I've reverted, locally, the commit e8f5722 but it still fails. I propose to exclude the tag |
The registration fails when assertion has the same name but different content in the scriptblock, are you registering the operators twice, each with different body? |
It's a part of the standard Pester tests. Under changing help (and the code reformatting, in some cases). I broke something during my actions :-/ |
Keep it failing I can have a look on it later. :) |
We created https://pester.dev in the meantime. |
https://github.com/PowerShell/platyPS
The text was updated successfully, but these errors were encountered: