Conversion of documents via Pandoc. Wraps pandoc.exe using CliWrap and provides strong typed options for document formats.
See Milestones for release notes.
https://nuget.org/packages/Pandoc/
By default pandoc.exe
is expected to be accessible in the current environmenst Path
.
This can be changed:
var engine = new PandocEngine(@"D:\Tools\pandoc.exe");
var html = await PandocInstance.ConvertToText<CommonMarkIn, HtmlOut>("*text*");
await using var inStream = File.OpenRead("sample.md");
await using var outStream = File.OpenWrite("output.html");
await PandocInstance.Convert<CommonMarkIn, HtmlOut>(inStream, outStream);
await PandocInstance.Convert<CommonMarkIn, HtmlOut>("sample.md", "output.html");
var html = await PandocInstance.ConvertToText(
"""
# Heading1
text
## Heading2
text
""",
new CommonMarkIn
{
ShiftHeadingLevelBy = 2
},
new HtmlOut
{
NumberOffsets = new List<int> {3}
});
Pan Flute designed by Creaticca Creative Agency from The Noun Project.