Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

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

README.md

Highlight

A relatively simple and extensible syntax highlighter written in C#.

TL;DR

Install-Package Highlight
var highlighter = new Highlighter(new HtmlEngine());
var highlightedCode = highlighter.Highlight("C#", csharpCode);

Syntax definitions

The following is a list of all the definition names of syntaxes/languages that are supported out of the box;

  • ASPX
  • C
  • C++
  • C#
  • COBOL
  • Eiffel
  • Fortran
  • Haskell
  • HTML
  • Java
  • JavaScript
  • Mercury
  • MSIL
  • Pascal
  • Perl
  • PHP
  • Python
  • Ruby
  • SQL
  • Visual Basic
  • VBScript
  • VB.NET
  • XML

Output engines

Highlight supports the notion of an output engine which makes it possible to get the syntax highlighted result output in any format. Out of the box Highlight support HTML, XML and RTF output formats.

The HtmlEngine supports inline styles which can be enabled by setting the UseCss property to true;

var highlighter = new Highlighter(new HtmlEngine { UseCss = true });
var highlightedCode = highlighter.Highlight("C#", csharpCode);

About

A relatively simple and extensible syntax highlighter written in C#.

Topics

Resources

License

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages

You can’t perform that action at this time.