Skip to content

ilich/Markdig.Prism

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 

Markdig.Prism

An extension that adds syntax highlighting to a Markdig pipeline through Prism.js JavaScript library.

Usage

  1. Add WebStoating.Markdig.Prism to your project.
dotnet add package WebStoating.Markdig.Prism --version 1.0.0
  1. Create Markdig pipeline
private static readonly MarkdownPipeline MarkdownPipeline = new MarkdownPipelineBuilder()
    .UseAdvancedExtensions()
    .UsePrism()
    .Build();
  1. Download Prism and add it to your Razor page or layout template.
<!DOCTYPE html>
<html>
<head>
	...
	<link href="themes/prism.css" rel="stylesheet" />
</head>
<body>
	...
	<script src="prism.js"></script>
</body>
</html>
  1. Convert Markdown to HTML
var html = Markdown.ToHtml(markdown, MarkdownPipeline);

About

Syntax highlighting for Markdig using Prism.js library

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages