alt3 / Docusaurus.Powershell

Docusaurus websites for PowerShell modules
https://docusaurus-powershell.vercel.app/
MIT License
28 stars 11 forks source link

Period followed by space causes line break in generated comment based help #151

Closed beau-witter closed 1 year ago

beau-witter commented 1 year ago

Following the discussion on this pr and noticing that this is still persisting https://pester.dev/docs/commands/New-PesterConfiguration#description it seems like there is still a regex that is a little too eager to help.

Unless the Pester 5.4.0 docs are not using the latest Alt3.Docusaurus.Powershell (which I cannot seem to tell what version it is using) then there may still be something amiss with that part of the generation.

bravo-kernel commented 1 year ago

The Pester 5.4.0 docs were generated using the latest Alt3-module.

I do not get what issue you are seeing here to be honest. Could provide an example or extend the test case at https://github.com/alt3/Docusaurus.Powershell/tree/main/Tests/Integration/CrossVersionCodeExamples?

beau-witter commented 1 year ago

Here is the example that I was referencing: Generated: image Source: image

From the looks of it, this was identified in the PR I linked, but it seems that there has not been a fix for it yet. Like I noted in the title, it appears to happen whenever the a line of text inside the riple-backtick code block contains multiple sentences (i.e. a period followed by a space).

I will also look into extending the test case at that link.

bravo-kernel commented 1 year ago

Thanks, I see now and totally missed that. Much appreciated 👍

bravo-kernel commented 1 year ago

Below image shows the raw output as produced by PlatyPs.

As you can see the linebreaks are already inserted before the Alt3 (post-processor) module ever touches it.

image

I think this should be solved in PlatyPS because there is no way we can "guess" whether the line breaks in the generated PlatyPS file are intentional or an error.

@fflaten FYI

fflaten commented 1 year ago

I think this should be solved in PlatyPS because there is no way we can "guess" whether the line breaks in the generated PlatyPS file are intentional or an error.

+1 👍 Tested with platyPS 2.0-preview? If it's the same, will either of you report in their repo?

bravo-kernel commented 1 year ago

I have tried to test with platy 2 some time ago but failed. The Alt3 module no longer runs after using v2. I was hoping to request your help some day, after I have cleaned up the current version.

bravo-kernel commented 1 year ago

I totally forgot but New-DocusaurusHelp outputs a Get-Item list of created files. The idea back then was that one could create custom post-processing to apply any site-specific fixes.

In this case, Pester docs generate-command-reference.ps1 could be extended to fix the options in New-PesterConfiguration.mdx. That way, the fix will stick forever.

image

bravo-kernel commented 1 year ago

Closing as this cannot be solved by the Alt3 module and solution is provided above.