mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-03 21:36:36 +00:00
Use Markdig from PowerShell #183
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @datenschieber on GitHub (Jan 18, 2018).
I am trying to use Markdig from PowerShell.
Addtype .\Markdig.dllruns without problems. The type[Markdig.Markdown]is available afterwards.The problem is that I am not able to create a Markdig object.
New-Object Markdig.Markdownfails with error messageNew-Object : A constructor was not found. Cannot find an appropriate constructor for type Markdig.Markdown.[Markdig.Markdown].GetConstructor()saysCannot find an overload for "GetConstructor" and the argument count: "0".. It seems that Markdig.Markdown doesn't provide usable constructors.Please provide a hint or an example for how to use Markdig from PowerShell. At the end I want to develop a PowerShell module that encapsulates Markdig with appropriate PowerShell advanced functions.
@xoofx commented on GitHub (Jan 18, 2018):
I barely use PowerShell so can't provide much help. But the class you are trying to use provides only static methods, so you can't create a new Mardown object obviously. Don't know the syntax in powershell but you should be able to access static methods likely.
@0xfeeddeadbeef commented on GitHub (Jan 18, 2018):
For example:
@datenschieber commented on GitHub (Jan 18, 2018):
That's it! Thanks for the hint! I am not familiar with C#...
The solution is easy now:
[Markdig.Markdown]::ToHtml("This is a text with some *emphasis*")