diff --git a/api/Markdown.ColorCode.HtmlFormatterType.html b/api/Markdown.ColorCode.HtmlFormatterType.html index 81b1697..71e95a4 100644 --- a/api/Markdown.ColorCode.HtmlFormatterType.html +++ b/api/Markdown.ColorCode.HtmlFormatterType.html @@ -105,11 +105,21 @@
Use the ColorCode
Use the ColorCode
Use the ColorCode
Use the ColorCode
Install-Package Markdown.ColorCode -Version 2.1.0
+Install-Package Markdown.ColorCode -Version 2.2.0
.NET CLI
-dotnet add package Markdown.ColorCode --version 2.1.0
+dotnet add package Markdown.ColorCode --version 2.2.0
Usage
To use this extension with Markdig, simply install the Markdown.ColorCode
package use the ColorCode extension:
@@ -146,6 +146,25 @@ Usage
var colorizedHtml = Markdig.Markdown.ToHtml(someMarkdown, pipeline);
+Improved C# Syntax Highlighting
+For an improved experience with C# code blocks, consider using the Markdown.ColorCode.CSharpToColoredHtml
package. This package provides a more robust syntax highlighting experience for C# code blocks by leveraging CSharpToColouredHtml.Core.
+var pipeline = new MarkdownPipelineBuilder()
+ .UseAdvancedExtensions()
+ .UseColorCodeWithCSharpToColoredHtml(
+ HtmlFormatterType.Style, // use style-based colorization (default)
+ myCustomStyleDictionary, // use a custom colorization style dictionary
+ myHtmlEmitterSettings, // configures CSharpToColouredHtml's HTML emitter
+ 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);
+
+
+Caution
+The CsharpToColouredHTML
package introduces dependencies which will not work well with Blazor WebAssembly projects. Either generate the HTML on the server side and send it to the client or use the base Markdown.ColorCode
package if you are working with Blazor WebAssembly. See https://github.com/dotnet/aspnetcore/issues/27373 and https://github.com/dotnet/aspnetcore/issues/26724 for more details on the problem.
+
Roadmap
See the open issues for a list of proposed features (and known issues).
Contributing
diff --git a/index.json b/index.json
index 469b523..d6868b6 100644
--- a/index.json
+++ b/index.json
@@ -7,7 +7,7 @@
"api/Markdown.ColorCode.HtmlFormatterType.html": {
"href": "api/Markdown.ColorCode.HtmlFormatterType.html",
"title": "Enum HtmlFormatterType | Markdown.ColorCode",
- "keywords": "Enum HtmlFormatterType The type of HTML formatter to use when converting markdown code blocks to HTML. Namespace : Markdown.ColorCode Assembly : Markdown.ColorCode.dll Syntax public enum HtmlFormatterType : int Fields Name Description Css Use the ColorCode to format the code using CSS classes. Style Use the ColorCode to format the code using inline style attributes."
+ "keywords": "Enum HtmlFormatterType The type of HTML formatter to use when converting markdown code blocks to HTML. Namespace : Markdown.ColorCode Assembly : Markdown.ColorCode.dll Syntax public enum HtmlFormatterType : int Fields Name Description Css Use the ColorCode to format the code using CSS classes. CssWithCSharpToColoredHtml Use the ColorCode to format the code using CSS classes, boosted with CsharpToColouredHTML.Core. Only usable with Markdown.ColorCode.CSharpToColoredHtml. Style Use the ColorCode to format the code using inline style attributes. StyleWithCSharpToColoredHtml Use the ColorCode to format the code using inline style attributes, boosted with CsharpToColouredHTML.Core. Only usable with Markdown.ColorCode.CSharpToColoredHtml."
},
"api/Markdown.ColorCode.MarkdownPipelineBuilderExtensions.html": {
"href": "api/Markdown.ColorCode.MarkdownPipelineBuilderExtensions.html",
@@ -17,6 +17,6 @@
"index.html": {
"href": "index.html",
"title": "Markdown.ColorCode | Markdown.ColorCode",
- "keywords": "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 { /// /// Gets a new Foo! /// /// A new Foo public void GetFoo() { return new Foo(); } } After using Foo.Bar.Baz; namespace Foo.Api; public interface FooService { /// /// Gets a new Foo! /// /// A new Foo 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 @wbaldoumas Project Link: https://github.com/wbaldoumas/markdown-colorcode Acknowledgements This README was adapted from https://github.com/othneildrew/Best-README-Template . "
+ "keywords": "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 { /// /// Gets a new Foo! /// /// A new Foo public void GetFoo() { return new Foo(); } } After using Foo.Bar.Baz; namespace Foo.Api; public interface FooService { /// /// Gets a new Foo! /// /// A new Foo public void GetFoo() { return new Foo(); } } Installation Package Manager Install-Package Markdown.ColorCode -Version 2.2.0 .NET CLI dotnet add package Markdown.ColorCode --version 2.2.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); Improved C# Syntax Highlighting For an improved experience with C# code blocks, consider using the Markdown.ColorCode.CSharpToColoredHtml package. This package provides a more robust syntax highlighting experience for C# code blocks by leveraging CSharpToColouredHtml.Core . var pipeline = new MarkdownPipelineBuilder() .UseAdvancedExtensions() .UseColorCodeWithCSharpToColoredHtml( HtmlFormatterType.Style, // use style-based colorization (default) myCustomStyleDictionary, // use a custom colorization style dictionary myHtmlEmitterSettings, // configures CSharpToColouredHtml's HTML emitter 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); Caution The CsharpToColouredHTML package introduces dependencies which will not work well with Blazor WebAssembly projects. Either generate the HTML on the server side and send it to the client or use the base Markdown.ColorCode package if you are working with Blazor WebAssembly. See https://github.com/dotnet/aspnetcore/issues/27373 and https://github.com/dotnet/aspnetcore/issues/26724 for more details on the problem. 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 @wbaldoumas Project Link: https://github.com/wbaldoumas/markdown-colorcode Acknowledgements This README was adapted from https://github.com/othneildrew/Best-README-Template . "
}
}
\ No newline at end of file
diff --git a/manifest.json b/manifest.json
index 5bc231d..1262818 100644
--- a/manifest.json
+++ b/manifest.json
@@ -18,7 +18,7 @@
"output": {
".html": {
"relative_path": "api/Markdown.ColorCode.HtmlFormatterType.html",
- "hash": "rdwqyRf8Rv3OaxvG5GTnkA=="
+ "hash": "LcmixfTWVNK0YSrWij00sg=="
}
},
"is_incremental": false,
@@ -69,7 +69,7 @@
"output": {
".html": {
"relative_path": "index.html",
- "hash": "TslH8geNTJHJZmAFluMMRA=="
+ "hash": "tL+XeaQG2CQ/+v5a7F4yMg=="
}
},
"is_incremental": false,
diff --git a/xrefmap.yml b/xrefmap.yml
index 153de04..d400695 100644
--- a/xrefmap.yml
+++ b/xrefmap.yml
@@ -19,12 +19,24 @@ references:
commentId: F:Markdown.ColorCode.HtmlFormatterType.Css
fullName: Markdown.ColorCode.HtmlFormatterType.Css
nameWithType: HtmlFormatterType.Css
+- uid: Markdown.ColorCode.HtmlFormatterType.CssWithCSharpToColoredHtml
+ name: CssWithCSharpToColoredHtml
+ href: api/Markdown.ColorCode.HtmlFormatterType.html#Markdown_ColorCode_HtmlFormatterType_CssWithCSharpToColoredHtml
+ commentId: F:Markdown.ColorCode.HtmlFormatterType.CssWithCSharpToColoredHtml
+ fullName: Markdown.ColorCode.HtmlFormatterType.CssWithCSharpToColoredHtml
+ nameWithType: HtmlFormatterType.CssWithCSharpToColoredHtml
- uid: Markdown.ColorCode.HtmlFormatterType.Style
name: Style
href: api/Markdown.ColorCode.HtmlFormatterType.html#Markdown_ColorCode_HtmlFormatterType_Style
commentId: F:Markdown.ColorCode.HtmlFormatterType.Style
fullName: Markdown.ColorCode.HtmlFormatterType.Style
nameWithType: HtmlFormatterType.Style
+- uid: Markdown.ColorCode.HtmlFormatterType.StyleWithCSharpToColoredHtml
+ name: StyleWithCSharpToColoredHtml
+ href: api/Markdown.ColorCode.HtmlFormatterType.html#Markdown_ColorCode_HtmlFormatterType_StyleWithCSharpToColoredHtml
+ commentId: F:Markdown.ColorCode.HtmlFormatterType.StyleWithCSharpToColoredHtml
+ fullName: Markdown.ColorCode.HtmlFormatterType.StyleWithCSharpToColoredHtml
+ nameWithType: HtmlFormatterType.StyleWithCSharpToColoredHtml
- uid: Markdown.ColorCode.MarkdownPipelineBuilderExtensions
name: MarkdownPipelineBuilderExtensions
href: api/Markdown.ColorCode.MarkdownPipelineBuilderExtensions.html