Markdown.ColorCode.CSharpToColoredHtml
2.2.0-preview-5
See the version list below for details.
dotnet add package Markdown.ColorCode.CSharpToColoredHtml --version 2.2.0-preview-5
NuGet\Install-Package Markdown.ColorCode.CSharpToColoredHtml -Version 2.2.0-preview-5
<PackageReference Include="Markdown.ColorCode.CSharpToColoredHtml" Version="2.2.0-preview-5" />
paket add Markdown.ColorCode.CSharpToColoredHtml --version 2.2.0-preview-5
#r "nuget: Markdown.ColorCode.CSharpToColoredHtml, 2.2.0-preview-5"
// Install Markdown.ColorCode.CSharpToColoredHtml as a Cake Addin #addin nuget:?package=Markdown.ColorCode.CSharpToColoredHtml&version=2.2.0-preview-5&prerelease // Install Markdown.ColorCode.CSharpToColoredHtml as a Cake Tool #tool nuget:?package=Markdown.ColorCode.CSharpToColoredHtml&version=2.2.0-preview-5&prerelease
Markdown.ColorCode
About The Project
An extension for Markdig that adds syntax highlighting to code through the power of ColorCode.
Demonstration
Before
using Foo.Bar.Baz;
namespace Foo.Api;
public interface FooService {
/// <summary>
/// Gets a new Foo!
/// </summary>
/// <returns>A new Foo</returns>
public void GetFoo() {
return new Foo();
}
}
After
using Foo.Bar.Baz;
namespace Foo.Api;
public interface FooService {
/// <summary>
/// Gets a new Foo!
/// </summary>
/// <returns>A new Foo</returns>
public void GetFoo() {
return new Foo();
}
}
Installation
Package Manager
Install-Package Markdown.ColorCode -Version 2.1.0
.NET CLI
dotnet add package Markdown.ColorCode --version 2.1.0
Usage
To use this extension with Markdig, simply install the Markdown.ColorCode
package use the ColorCode extension:
var pipeline = new MarkdownPipelineBuilder()
.UseAdvancedExtensions()
.UseColorCode()
.Build();
var colorizedHtml = Markdig.Markdown.ToHtml(someMarkdown, pipeline);
Several optional configuration options are also at your disposal:
var pipeline = new MarkdownPipelineBuilder()
.UseAdvancedExtensions()
.UseColorCode(
HtmlFormatterType.Style, // use style-based colorization (default)
myCustomStyleDictionary, // use a custom colorization style dictionary
myAdditionalLanguages, // augment the built-in language support
myCustomLanguageId // set a default language ID to fall back to
)
.Build();
var colorizedHtml = Markdig.Markdown.ToHtml(someMarkdown, pipeline);
Roadmap
See the open issues for a list of proposed features (and known issues).
Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated. For detailed contributing guidelines, please see CONTRIBUTING.md.
License
Distributed under the MIT License
License. See LICENSE
for more information.
Contact
Project Link: https://github.com/wbaldoumas/markdown-colorcode
Acknowledgements
This README
was adapted from
https://github.com/othneildrew/Best-README-Template.
Product | Versions 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 is compatible. 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. |
-
net7.0
- ColorCode.Core (>= 2.0.15)
- CsharpToColouredHTML.Core (>= 1.0.41)
- Markdown.ColorCode (>= 2.2.0-preview-5)
-
net8.0
- ColorCode.Core (>= 2.0.15)
- CsharpToColouredHTML.Core (>= 1.0.41)
- Markdown.ColorCode (>= 2.2.0-preview-5)
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 |
---|---|---|
2.3.0 | 593 | 7/17/2024 |
2.2.2 | 369 | 4/30/2024 |
2.2.1 | 297 | 2/18/2024 |
2.2.0 | 164 | 2/13/2024 |
2.2.0-preview-5 | 99 | 2/13/2024 |