Skip to content

Schema forces script output to get syntax highlighting #243

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

Closed
zjalexander opened this issue Dec 9, 2016 · 2 comments
Closed

Schema forces script output to get syntax highlighting #243

zjalexander opened this issue Dec 9, 2016 · 2 comments

Comments

@zjalexander
Copy link

The schema forces overaggressive codeblocks which include output. Our own help then gets formatted strangely, but we can't correct the issue without PlatyPS failing the schema check.

Can we alter the proposal so it doesn't look so counter-intuitively weird?

Steps to reproduce

See:
https://msdn.microsoft.com/en-us/powershell/reference/5.1/microsoft.powershell.utility/export-csv
MicrosoftDocs/PowerShell-Docs#808
MicrosoftDocs/PowerShell-Docs#895

Expected behavior

PS C:\>Get-Process | Export-Csv -Path "processes.csv"
  # In processes.csv
  #TYPE System.Diagnostics.Process
__NounName,Name,Handles,VM,WS,PM,NPM,Path,Company,CPU,FileVersion,... Process,powershell,626,201666560,76058624,61943808,11960,C:\WINDOWS... Process,powershell,257,151920640,38322176,37052416,7836,C:\WINDOWS\...

Actual behavior

 PS C:\>Get-Process | Export-Csv -Path "processes.csv"
  # In processes.csv
  #TYPE System.Diagnostics.Process
#__NounName,Name,Handles,VM,WS,PM,NPM,Path,Company,CPU,FileVersion,... #Process,powershell,626,201666560,76058624,61943808,11960,C:\WINDOWS... #Process,powershell,257,151920640,38322176,37052416,7836,C:\WINDOWS\...

Environment data

all versions of PowerShell, webhelp

@zjalexander
Copy link
Author

suggestion from @joeyaiello is to tokenize between Example headers instead of tokenizing on codeblocks.

@vors
Copy link
Collaborator

vors commented Dec 21, 2016

PlatyPS scheme doesn't force language moniker in Examples.

In your example the source is (note there is no language moniker)

### Example 2: Export processes to a comma-delimited file
```
PS C:\> Get-Process | Export-Csv -Path "processes.csv"
# In processes.csv
#TYPE System.Diagnostics.Process
__NounName,Name,Handles,VM,WS,PM,NPM,Path,Company,CPU,FileVersion,... Process,powershell,626,201666560,76058624,61943808,11960,C:\WINDOWS... Process,powershell,257,151920640,38322176,37052416,7836,C:\WINDOWS\...
```

I suspect that it could be addressed on the Open Publishing System side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants