Skip to content
Open core software, built in Singapore Established 2018  /  Five utilities
Jering
Talk to us

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

Package Manager
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.

Reference shelf