dataplat / dbatools

🚀 SQL Server automation and instance migrations have never been safer, faster or freer
https://dbatools.io
MIT License
2.39k stars 787 forks source link

Invoke-DbaQuery's parameter list is oddly formatted. This appears to break the online docs and Get-Help. #9367

Closed ReeceGoding closed 3 weeks ago

ReeceGoding commented 1 month ago

Verified issue does not already exist?

I have searched and found no existing issue

What error did you receive?

No error. The issue is visual. The website shows it best. The highlighted items are missing both brackets and line breaks. image

Similarly, the documentation that you see when you run Get-Help Invoke-DbaQuery -full is missing the brackets around the parameters that are missing both brackets and line breaks in the above screenshot.

Steps to Reproduce

Check the Syntax section at either

Get-Help Invoke-DbaQuery -full`

or https://docs.dbatools.io/Invoke-DbaQuery.html

Please confirm that you are running the most recent version of dbatools

Yes. 2.1.16.

Other details or mentions

I see nothing obviously wrong in master/public/Invoke-DbaQuery.ps1, unless it's getting confused by the reference to "[MyTable]"? Perhaps I am looking in the wrong file?

What PowerShell host was used when producing this error

Windows PowerShell (powershell.exe)

PowerShell Host Version

I would be stunned if this matters.

SQL Server Edition and Build number

I would be stunned if this matters.

.NET Framework Version

I would be stunned if this matters.

wsmelton commented 1 month ago
image

These are not expected to have brackets as they are assigned mandatory in the parameter set for each of them.

Our rendering code for the doc's site must not be able to determine/detect line break is needed which is why those are not showing on different lines.

niphlod commented 1 month ago

I'll see if the site can insert a newline properly so every param is on its own line (e.g. between -Database and -Query, etc)

niphlod commented 1 month ago

soooo, I think I fixed this AND found a way to render our docs even better.

First, as "it is"

image

And as "it'll be"

image

Also, we weren't preserving correctly line breaks within paragraphs....

So, this is as "it is"

image

while this is as "it'll be" image

the line break are more closely related to what the inline help has as lines image

so it should be better without breaking anything for all similar helps

Slightly different, but preserved nonetheless is, e.g., EnableException, which the inline code has as

image

it's now currently rendered as image

and it'll be image

@wsmelton , @potatoqualitee , @andreasjordan , do we wanna give it a try ?

wsmelton commented 1 month ago

I don't see any difference going to the docs.dbatools.io. Is there a different way?

niphlod commented 1 month ago

@wsmelton I was asking BEFORE implementing the changes on the site. We don't have a "test site", but I can send the modified script that the GH Action runs, so you can do what the GH Action do and build it locally if you need previews of all of the pages, if needed.

andreasjordan commented 1 month ago

The proposed change seems good to me.

niphlod commented 1 month ago

if no other comments are coming I'm going to push the changes this weekend

niphlod commented 4 weeks ago

I pushed to the docs repo the new logic and manually refreshed the site. This PR https://github.com/dataplat/dbatools/pull/9377 just alignes the private, internal function, for people wanting to have a preview of how the docs page will be once built, with the new and "improved" rendering logic.

potatoqualitee commented 3 weeks ago

thank you @niphlod 😊 your docs updates are always a lifesaver.