Skip to content

Commit

Permalink
Deploying to gh-pages from @ b4bb8b6 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
wbaldoumas committed Feb 13, 2024
1 parent c21cf11 commit 7f8a015
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 6 deletions.
10 changes: 10 additions & 0 deletions api/Markdown.ColorCode.HtmlFormatterType.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,21 @@ <h3 id="fields">Fields
<tr>
<td id="Markdown_ColorCode_HtmlFormatterType_Css">Css</td>
<td><p>Use the ColorCode <see cref="!:HtmlClassFormatter"></see> to format the code using CSS classes.</p>
</td>
</tr>
<tr>
<td id="Markdown_ColorCode_HtmlFormatterType_CssWithCSharpToColoredHtml">CssWithCSharpToColoredHtml</td>
<td><p>Use the ColorCode <see cref="!:HtmlClassFormatter"></see> to format the code using CSS classes, boosted with CsharpToColouredHTML.Core. Only usable with Markdown.ColorCode.CSharpToColoredHtml.</p>
</td>
</tr>
<tr>
<td id="Markdown_ColorCode_HtmlFormatterType_Style">Style</td>
<td><p>Use the ColorCode <see cref="!:HtmlFormatter"></see> to format the code using inline style attributes.</p>
</td>
</tr>
<tr>
<td id="Markdown_ColorCode_HtmlFormatterType_StyleWithCSharpToColoredHtml">StyleWithCSharpToColoredHtml</td>
<td><p>Use the ColorCode <see cref="!:HtmlFormatter"></see> to format the code using inline style attributes, boosted with CsharpToColouredHTML.Core. Only usable with Markdown.ColorCode.CSharpToColoredHtml.</p>
</td>
</tr>
</tbody>
Expand Down
23 changes: 21 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ <h3 id="after">After</h3>
</code></pre>
<h2 id="installation">Installation</h2>
<h3 id="package-manager">Package Manager</h3>
<pre><code class="lang-text">Install-Package Markdown.ColorCode -Version 2.1.0
<pre><code class="lang-text">Install-Package Markdown.ColorCode -Version 2.2.0
</code></pre>
<h3 id="net-cli">.NET CLI</h3>
<pre><code class="lang-text">dotnet add package Markdown.ColorCode --version 2.1.0
<pre><code class="lang-text">dotnet add package Markdown.ColorCode --version 2.2.0
</code></pre>
<h2 id="usage">Usage</h2>
<p>To use this extension with <a href="https://github.com/xoofx/markdig">Markdig</a>, simply install the <code>Markdown.ColorCode</code> package use the ColorCode extension:</p>
Expand All @@ -146,6 +146,25 @@ <h2 id="usage">Usage</h2>

var colorizedHtml = Markdig.Markdown.ToHtml(someMarkdown, pipeline);
</code></pre>
<h3 id="improved-c-syntax-highlighting">Improved C# Syntax Highlighting</h3>
<p>For an improved experience with C# code blocks, consider using the <code>Markdown.ColorCode.CSharpToColoredHtml</code> package. This package provides a more robust syntax highlighting experience for C# code blocks by leveraging <a href="https://github.com/Swiftly1/CsharpToColouredHTML">CSharpToColouredHtml.Core</a>.</p>
<pre><code class="lang-cs">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);
</code></pre>
<div class="CAUTION">
<h5>Caution</h5>
<p>The <code>CsharpToColouredHTML</code> 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 <code>Markdown.ColorCode</code> package if you are working with Blazor WebAssembly. See <a href="https://github.com/dotnet/aspnetcore/issues/27373">https://github.com/dotnet/aspnetcore/issues/27373</a> and <a href="https://github.com/dotnet/aspnetcore/issues/26724">https://github.com/dotnet/aspnetcore/issues/26724</a> for more details on the problem.</p>
</div>
<h2 id="roadmap">Roadmap</h2>
<p>See the <a href="https://github.com/wbaldoumas/markdown-colorcode/issues">open issues</a> for a list of proposed features (and known issues).</p>
<h2 id="contributing">Contributing</h2>
Expand Down
4 changes: 2 additions & 2 deletions index.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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 { /// <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 @wbaldoumas Project Link: https://github.com/wbaldoumas/markdown-colorcode Acknowledgements This README was adapted from https://github.com/othneildrew/Best-README-Template . <!-- MARKDOWN LINKS & IMAGES --> <!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->"
"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 { /// <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.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 . <!-- MARKDOWN LINKS & IMAGES --> <!-- https://www.markdownguide.org/basic-syntax/#reference-style-links -->"
}
}
4 changes: 2 additions & 2 deletions manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"output": {
".html": {
"relative_path": "api/Markdown.ColorCode.HtmlFormatterType.html",
"hash": "rdwqyRf8Rv3OaxvG5GTnkA=="
"hash": "LcmixfTWVNK0YSrWij00sg=="
}
},
"is_incremental": false,
Expand Down Expand Up @@ -69,7 +69,7 @@
"output": {
".html": {
"relative_path": "index.html",
"hash": "TslH8geNTJHJZmAFluMMRA=="
"hash": "tL+XeaQG2CQ/+v5a7F4yMg=="
}
},
"is_incremental": false,
Expand Down
12 changes: 12 additions & 0 deletions xrefmap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7f8a015

Please sign in to comment.