StatiCSharp.Parser.CSharpToColoredHtml 0.1.0

dotnet add package StatiCSharp.Parser.CSharpToColoredHtml --version 0.1.0
NuGet\Install-Package StatiCSharp.Parser.CSharpToColoredHtml -Version 0.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="StatiCSharp.Parser.CSharpToColoredHtml" Version="0.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add StatiCSharp.Parser.CSharpToColoredHtml --version 0.1.0
#r "nuget: StatiCSharp.Parser.CSharpToColoredHtml, 0.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install StatiCSharp.Parser.CSharpToColoredHtml as a Cake Addin
#addin nuget:?package=StatiCSharp.Parser.CSharpToColoredHtml&version=0.1.0

// Install StatiCSharp.Parser.CSharpToColoredHtml as a Cake Tool
#tool nuget:?package=StatiCSharp.Parser.CSharpToColoredHtml&version=0.1.0

C# to colored HTML parser

This is a port of Swiftly1's CsharpToColouredHTML for StatiC#, a static website generator for C# developers. Requiring StatiC# 0.4.0 or higher.

By injecting this parser into StatiC#'s website-generating process all C# code parts of your markdown files are rendered to look as if it was inside Visual Studio or Visual Studio Code.

How to use

Initiate a new instance of the parser. It's optional to disable line numbers in the output. Then inject the parser into StatiC#'s website manager:

using StatiCSharp.Parser.CSharpToColoredHtmlParser;

// ...

var parser = new CSharpToColoredHtmlParser()
    .DisableLineNumbers();                      // Optional

manager.AddParser(parser);

await manager.Make();

You have to mark the code parts in the markdown files:

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt  
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation  
ullamco laboris nisi ut aliquip ex ea commodo consequat.

```C#
// Your C# code in here...
`` ``` ``

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt  
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation  
ullamco laboris nisi ut aliquip ex ea commodo consequat.

CsharpToColouredHTML

⇒ Check out the original project of Swiftly1 here: Link

Product Compatible and additional computed target framework versions.
.NET net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.1.0 153 4/12/2023

Initital relase with the basic functionality.