Pygments NuGet Package

The Pygments for .NET library exposes two properties and four methods in the Pygments.Highlighter class

public static IEnumerable<Lexer> Lexers; // all the language lexers available

public static IEnumerable<string> Styles; // all the Styles available


public string HighlightToBBCode( ..

)
public string HighlightToRTF( ..)
public string HighlightToHtml( ..

)
public string HighlightToLatex( ..)


Example:


using System.IO;

namespace test {
class Program {
static void Main(string[] args)
{
var highlighter = new Pygments.Highlighter();
var src = File.ReadAllText(@"program.cs");
File.WriteAllText("output.html", highlighter.HighlightToHtml(src, "c#", "vs", highlightLines: "7 8 9 10"));
}
}
}.




Got any Pygments Question?





Info

Version: 2.0.2.2
Author(s): fearthecowboy coapp
Last Update: Wednesday, July 22, 2015
.NET Fiddle: Create the first Fiddle
Project Url: https://github.com/fearthecowboy/pygments
NuGet Url: https://www.nuget.org/packages/FearTheCowboy.Pygments


Install
Install-Package FearTheCowboy.Pygments
dotnet add package FearTheCowboy.Pygments
paket add FearTheCowboy.Pygments
FearTheCowboy.Pygments Download (Unzip the "nupkg" after downloading)





STATS

must-have-score

avg-downloads-per-day

0

days-since-last-release

3194