Utility 03 / Highlight code in .NET
Jering.Web.SyntaxHighlighters.HighlightJS
Use the syntax highlighter, HighlightJS, from C#.
Overview
A .NET wrapper around highlight.js. It runs the highlighter in Node.js and returns highlighted markup that uses the standard hljs class prefix.
- Highlight source code with a highlight.js language alias.
- Set a custom class prefix when your styles require one.
- Validate language aliases before highlighting.
- Use dependency injection or the StaticHighlightJSService wrapper.
Install
dotnet add package Jering.Web.SyntaxHighlighters.HighlightJS
Documentation
Go straight to the part you need.
The first call lives in the quick start. The advanced notes cover configuration, errors and the decisions that matter in production.
Documentation homeInstall, requirements and the full page index.
Start hereMake the first call with a complete example.
Advanced notesConfiguration, lifecycle and production concerns.
ChangelogVersions, dates and notable changes.
LicensesTerms, dependencies and attribution.
ContactEmail and the public issue tracker.