This repository s for the NuGet package Microsoft.PowerShell.MarkdownRender
.
The component is used by Show-Markdown
and ConvertFrom-Markdown
PowerShell cmdlets.
This component is planned to be used by PlatyPS as well.
License: MIT License
Like PowerShell/PowerShell#14444 (comment) explains, Show-Markdown
appears to output an unnecessary [Environment]::NewLine
after invocation, which makes it difficult to read (because it doesn't even use one before the output too). https://github.com/MicrosoftDocs/PowerShell-Docs/blob/6ff8e52c11aabb6ea5724a6bd2952adfb6f2df12/reference/7.5/Microsoft.PowerShell.Utility/Show-Markdown.md#syntax doesn't list a way to disable this.
Don't emit a [Environment]::NewLine
prepended to the output, or at the least, prepend one.
Reported here due to https://github.com/PowerShell/MarkdownRender/blob/d26903f1ba6efda8912662794977b4b718b5f68e/README.md?plain=1#L4:~:text=the%20component%20is%20used%20by%20%60show-markdown%60.
I've tested this on:
sudo snap install $(what-snap 'JSNnoJl3EqkMuWoy5Dgq8PMqZ0uNcpie' | awk '{print $2}') --classic --channel=latest/stable --revision 264 # https://forum.snapcraft.io/t/can-i-install-a-package-using-its-snap-id/39053/4?u=beedellrokejulianloc
The version of MarkDig used in the module is 0.22.0
. The latest version of MarkDig is 0.30.2
.
Because this module is loaded in PowerShell automatically, a non-binary module has no way of using a newer version of MarkDig. There are two particular features added in later releases that would be extremely useful for module authors: the Descendants() method and the ability to round-trip markdown.
Version 0.22.0
was released in October 2020. I suspect that the longer we go between updating the version here, the more work is involved in doing a future update.
Update the version of MarkDig.Signed to the latest version and adjust tests/implementation as required to keep existing functionality.
For details look at comment:
PowerShell/PowerShell#14090 (comment)
As a user, I want to be able to more seamlessly work with Markdown in PowerShell.
Unfortunately, when I try to ToString() a Markdown object, I get:
Microsoft.PowerShell.MarkdownRender.MarkdownInfo
This makes easily embedding markdown inside of a string more painful than it needs to be, and also complicates logic for -joining multiple markdowns
The .ToString()
method the MarkdownInfo class should be the converted HTML.
This does not render correctly:
1. `inline code`
2. item 2
3. item 3
* `inline code`
* item 2
* item 3
1. inline code
2. item 2
3. item 3
* inline code
* item 2
* item 3
1. inline code2. item 2
3. item 3
* inline code* item 2
* item 3
No response
Name Value
---- -----
PSVersion 7.3.0
PSEdition Core
GitCommitId 7.3.0
OS Microsoft Windows 10.0.19044
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
pwsh 7.3.0
As a developer working on a PowerShell module that interacts with Markdown, I want to be able to use newer versions of the Markdig library without conflict errors. Because Markdig isn't loaded in an ALC, using a newer version of Markdig in my module isn't feasible.
One reason to desire a newer version of the library is to gain access to the round-tripping support and more walkable AST.
Update the module to load Markdig in an ALC. No change is required to the version of Markdig used.
In VT100EscapeSequences.cs is the following code
// MacOS terminal app does not support extended colors for VT100, so we special case for it.
Code = RuntimeInformation.IsOSPlatform(OSPlatform.OSX) ? CodeMacOS : isDarkTheme ? CodeDark : CodeLight;
This would not work if the user is using MacOS to ssh to another platform and running PowerShell there (eg a linux host in the cloud), or using another platform and using SSH to talk to a MacOS machine (eg a build server).
No response
Related to PowerShell/PowerShell#16857.
This is already a native feature of Markdig, so it should be as easy as calling .UseYamlFrontMatter() on MarkdownPipelineBuilder before .Build().
Given that these are essentially document properties, a property added to [Microsoft.PowerShell.MarkdownRender.MarkdownInfo] instances that extracts YAML frontmatter (if present) and deserializes to a CLR object would likely be the most sensible to use.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.