WebStoating.Markdig.PrismWithPlugins
1.0.0
dotnet add package WebStoating.Markdig.PrismWithPlugins --version 1.0.0
NuGet\Install-Package WebStoating.Markdig.PrismWithPlugins -Version 1.0.0
<PackageReference Include="WebStoating.Markdig.PrismWithPlugins" Version="1.0.0" />
paket add WebStoating.Markdig.PrismWithPlugins --version 1.0.0
#r "nuget: WebStoating.Markdig.PrismWithPlugins, 1.0.0"
// Install WebStoating.Markdig.PrismWithPlugins as a Cake Addin #addin nuget:?package=WebStoating.Markdig.PrismWithPlugins&version=1.0.0 // Install WebStoating.Markdig.PrismWithPlugins as a Cake Tool #tool nuget:?package=WebStoating.Markdig.PrismWithPlugins&version=1.0.0
Markdig.Prism (Forked Version)
This is a forked version of the Markdig.Prism library, an extension that adds syntax highlighting to a Markdig pipeline through Prism.js JavaScript library.
This forked version includes additional features such as a download button for code blocks. Please note that some of these features require additional JavaScript to function correctly.
Usage
- Add this forked version of
Markdig.Prism
to your project.
dotnet add package WebStoating.Markdig.PrismWithPlugins --version 1.0.0
- Create Markdig pipeline
private static readonly MarkdownPipeline MarkdownPipeline = new MarkdownPipelineBuilder()
.UseAdvancedExtensions()
.UsePrism()
.Build();
- Download Prism and add it to your Razor page or layout template. Make sure to include the additional JavaScript required for the plugins.
<!DOCTYPE html>
<html>
<head>
...
<link href="themes/prism.css" rel="stylesheet" />
</head>
<body>
...
<script src="prism.js"></script>
<script src="yourAdditionalScript.js"></script>
</body>
</html>
- Convert Markdown to HTML
var html = Markdown.ToHtml(markdown, MarkdownPipeline);
Configuration
You can configure the extension by passing a PrismExtensionOptions
object to the UsePrism
method.
private static readonly MarkdownPipeline MarkdownPipeline = new MarkdownPipelineBuilder()
.UseAdvancedExtensions()
.UsePrism(new PrismExtensionOptions
{
UseDownloadButton = true,
UseLineNumbers = true,
})
.Build();
It will default to the following options:
new PrismExtensionOptions
{
UseDownloadButton = false,
UseLineNumbers = false,
}
Supported Plugins
Supported | Plugin Name | Usage Guide |
---|---|---|
❌ | Line Highlight | Guide |
✅ | Line Numbers | Guide |
❌ | Show Invisibles | Guide |
❌ | Autolinker | Guide |
❌ | WebPlatform Docs | Guide |
❌ | Custom Class | Guide |
❌ | File Highlight | Guide |
❌ | Show Language | Guide |
❌ | JSONP Highlight | Guide |
❌ | Highlight Keywords | Guide |
❌ | Remove initial line feed | Guide |
❌ | Inline color | Guide |
❌ | Previewers | Guide |
❌ | Autoloader | Guide |
❌ | Keep Markup | Guide |
❌ | Command Line | Guide |
❌ | Unescaped Markup | Guide |
❌ | Normalize Whitespace | Guide |
❌ | Data-URI Highlight | Guide |
✅ | Toolbar | Guide |
✅ | Copy to Clipboard Button | Guide |
✅ | Download Button | Guide |
❌ | Match braces | Guide |
❌ | Diff Highlight | Guide |
❌ | Filter highlightAll | Guide |
❌ | Treeview | Guide |
Credits
This library is a fork of Markdig.Prism by Ilya Verbitskiy. All credit for the original work goes to them.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Markdig (>= 0.22.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0 | 777 | 7/5/2023 |
This version added the UseDownloadBotton and UseLineNumbers to the pipeline.