-
Notifications
You must be signed in to change notification settings - Fork 12
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
Feature: Synopsis in MetaDescription #185
Comments
I have three things on my list for this weekend. After that, I am open to accept a PR for this ;) |
Cool. No promises on PR, maybe in July. Considered it free-for-all 🙂 |
Cany you explain in concrete steps what you are suggesting? Description currently handled in this function? |
Basically just add (+ tests): $synopsis = (Get-Help $powershellCommandName).Synopsis
# Ignore for commands with missing synopsis (they return `<linebreak><commandName> <linebreak>`)
if (($synopsis -replace '^\s+|\s+$') -ne $powershellCommandName) {
$description = [regex]::replace($MetaDescription, '%2', $synopsis)`
} |
I understand but the code is currently not "aware" of the commands or content during the md(x) processing as you can see here. This would require reading in each command during the md-parsing process making me wonder if this does not better belong in userland/post-processing. |
Besides unit testing the module is always imported when Regardless, it is always aware of the platyPS mdx, so we could extract synopsis from that if that's better. If you think it belongs in userland that's fine. Just thought it might be a common use case worth covering OOB when there's already variable-support. |
Ah, yes, I see now. Open to PR :) |
Consider making command help synopsis available as a variable in
-MetaDescription
like%2
.I know Maester currently post-processes this using:
https://github.com/maester365/maester/blob/773ef48b864efe236fd497164198aea4589fc5e1/build/Update-CommandReference.ps1#L23-L31
The text was updated successfully, but these errors were encountered: