{"id":18690852,"url":"https://github.com/wbaldoumas/markdown-colorcode","last_synced_at":"2025-04-12T06:09:41.381Z","repository":{"id":38215873,"uuid":"446190655","full_name":"wbaldoumas/markdown-colorcode","owner":"wbaldoumas","description":"An extension for Markdig that adds syntax highlighting to code through the power of ColorCode-Universal.","archived":false,"fork":false,"pushed_at":"2025-03-21T06:49:59.000Z","size":1035,"stargazers_count":36,"open_issues_count":1,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T06:09:20.913Z","etag":null,"topics":["color","colorcode","colorcode-universal","colorization","hacktoberfest","markdig","markdown","syntax-highlighting"],"latest_commit_sha":null,"homepage":"https://wbaldoumas.github.io/markdown-colorcode/","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wbaldoumas.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-09T20:03:52.000Z","updated_at":"2025-03-21T06:50:03.000Z","dependencies_parsed_at":"2023-11-30T03:24:08.227Z","dependency_job_id":"4e15c4b3-35af-429b-bf3c-34532edb916c","html_url":"https://github.com/wbaldoumas/markdown-colorcode","commit_stats":null,"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wbaldoumas%2Fmarkdown-colorcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wbaldoumas%2Fmarkdown-colorcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wbaldoumas%2Fmarkdown-colorcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wbaldoumas%2Fmarkdown-colorcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wbaldoumas","download_url":"https://codeload.github.com/wbaldoumas/markdown-colorcode/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248525139,"owners_count":21118619,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["color","colorcode","colorcode-universal","colorization","hacktoberfest","markdig","markdown","syntax-highlighting"],"created_at":"2024-11-07T10:51:16.560Z","updated_at":"2025-04-12T06:09:41.375Z","avatar_url":"https://github.com/wbaldoumas.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Markdown.ColorCode\n\n[![Build][github-checks-shield]][github-checks-url]\n[![Coverage][coverage-shield]][coverage-url]\n\n[![Version][nuget-version-shield]][nuget-url]\n[![Downloads][nuget-downloads-shield]][nuget-url]\n\n[![Contributor Covenant][contributor-covenant-shield]][contributor-covenant-url]\n[![Contributors][contributors-shield]][contributors-url]\n[![Commits][last-commit-shield]][last-commit-url]\n\n[![Forks][forks-shield]][forks-url]\n[![Stargazers][stars-shield]][stars-url]\n[![Issues][issues-shield]][issues-url]\n[![MIT License][license-shield]][license-url]\n\n[![LinkedIn][linkedin-shield]][linkedin-url]\n\n## About The Project\n\nAn extension for [Markdig](https://github.com/xoofx/markdig) that adds syntax highlighting to code through the power of [ColorCode](https://github.com/CommunityToolkit/ColorCode-Universal).\n\n## Demonstration\n\n### Before\n\n```text\nusing Foo.Bar.Baz;\n\nnamespace Foo.Api;\n\npublic interface FooService {\n    /// \u003csummary\u003e\n    ///     Gets a new Foo!\n    /// \u003c/summary\u003e\n    /// \u003creturns\u003eA new Foo\u003c/returns\u003e\n    public void GetFoo() {\n        return new Foo();\n    }\n}\n```\n\n### After\n\n```csharp\nusing Foo.Bar.Baz;\n\nnamespace Foo.Api;\n\npublic interface FooService {\n    /// \u003csummary\u003e\n    ///     Gets a new Foo!\n    /// \u003c/summary\u003e\n    /// \u003creturns\u003eA new Foo\u003c/returns\u003e\n    public void GetFoo() {\n        return new Foo();\n    }\n}\n```\n\n## Installation\n\n### Package Manager\n\n```text\nInstall-Package Markdown.ColorCode -Version 3.0.0\n```\n\n### .NET CLI\n\n```text\ndotnet add package Markdown.ColorCode --version 3.0.0\n```\n\n## Usage\n\nTo use this extension with [Markdig](https://github.com/xoofx/markdig), simply install the `Markdown.ColorCode` package use the ColorCode extension:\n\n```cs\nvar pipeline = new MarkdownPipelineBuilder()\n    .UseAdvancedExtensions()\n    .UseColorCode()\n    .Build();\n\nvar colorizedHtml = Markdig.Markdown.ToHtml(someMarkdown, pipeline);\n```\n\nSeveral optional configuration options are also at your disposal:\n\n```cs\nvar pipeline = new MarkdownPipelineBuilder()\n    .UseAdvancedExtensions()\n    .UseColorCode(\n        HtmlFormatterType.Style, // use style-based colorization (default)\n        myCustomStyleDictionary, // use a custom colorization style dictionary\n        myAdditionalLanguages, // augment the built-in language support\n        myCustomLanguageId // set a default language ID to fall back to\n    )\n    .Build();\n\nvar colorizedHtml = Markdig.Markdown.ToHtml(someMarkdown, pipeline);\n```\n\n### Improved C# Syntax Highlighting\n\nFor 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](https://github.com/Swiftly1/CsharpToColouredHTML).\n\n```cs\nvar pipeline = new MarkdownPipelineBuilder()\n    .UseAdvancedExtensions()\n    .UseColorCodeWithCSharpToColoredHtml(\n        HtmlFormatterType.Style, // use style-based colorization (default)\n        myCustomStyleDictionary, // use a custom colorization style dictionary\n        myHtmlEmitterSettings, // configures CSharpToColouredHtml's HTML emitter\n        myAdditionalLanguages, // augment the built-in language support\n        myCustomLanguageId // set a default language ID to fall back to\n    )\n    .Build();\n\nvar colorizedHtml = Markdig.Markdown.ToHtml(someMarkdown, pipeline);\n```\n\n\u003e [!NOTE]\n\u003e 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.\n\n## Roadmap\n\nSee the [open issues](https://github.com/wbaldoumas/markdown-colorcode/issues) for a list of proposed features (and known issues).\n\n## Contributing\n\nContributions 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](CONTRIBUTING.md).\n\n## License\n\nDistributed under the `MIT License` License. See `LICENSE` for more information.\n\n## Contact\n\n[@wbaldoumas](https://github.com/wbaldoumas)\n\nProject Link: [https://github.com/wbaldoumas/markdown-colorcode](https://github.com/wbaldoumas/markdown-colorcode)\n\n## Acknowledgements\n\nThis `README` was adapted from\n[https://github.com/othneildrew/Best-README-Template](https://github.com/othneildrew/Best-README-Template).\n\n\u003c!-- MARKDOWN LINKS \u0026 IMAGES --\u003e\n\u003c!-- https://www.markdownguide.org/basic-syntax/#reference-style-links --\u003e\n[contributors-shield]: https://img.shields.io/github/contributors/wbaldoumas/markdown-colorcode.svg?style=for-the-badge\n[contributors-url]: https://github.com/wbaldoumas/markdown-colorcode/graphs/contributors\n[contributor-covenant-shield]: https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg?style=for-the-badge\n[contributor-covenant-url]: https://github.com/wbaldoumas/markdown-colorcode/blob/main/CODE_OF_CONDUCT.md\n[forks-shield]: https://img.shields.io/github/forks/wbaldoumas/markdown-colorcode.svg?style=for-the-badge\n[forks-url]: https://github.com/wbaldoumas/markdown-colorcode/network/members\n[stars-shield]: https://img.shields.io/github/stars/wbaldoumas/markdown-colorcode.svg?style=for-the-badge\n[stars-url]: https://github.com/wbaldoumas/markdown-colorcode/stargazers\n[issues-shield]: https://img.shields.io/github/issues/wbaldoumas/markdown-colorcode.svg?style=for-the-badge\n[issues-url]: https://github.com/wbaldoumas/markdown-colorcode/issues\n[license-shield]: https://img.shields.io/github/license/wbaldoumas/markdown-colorcode.svg?style=for-the-badge\n[license-url]: https://github.com/wbaldoumas/markdown-colorcode/blob/main/LICENSE\n[linkedin-shield]: https://img.shields.io/badge/-LinkedIn-black.svg?style=for-the-badge\u0026logo=linkedin\u0026colorB=555\n[linkedin-url]: https://linkedin.com/in/williambaldoumas\n[github-checks-shield]: https://img.shields.io/github/actions/workflow/status/wbaldoumas/markdown-colorcode/build-test.yml?style=for-the-badge\n[github-checks-url]: https://github.com/wbaldoumas/markdown-colorcode/actions\n[coverage-shield]: https://img.shields.io/codecov/c/github/wbaldoumas/markdown-colorcode?style=for-the-badge\n[coverage-url]: https://app.codecov.io/gh/wbaldoumas/markdown-colorcode/branch/main\n[nuget-version-shield]: https://img.shields.io/nuget/v/markdown.colorcode?style=for-the-badge\n[nuget-downloads-shield]: https://img.shields.io/nuget/dt/markdown.colorcode?style=for-the-badge\n[nuget-url]: https://www.nuget.org/packages/markdown.colorcode/\n[last-commit-shield]: https://img.shields.io/github/last-commit/wbaldoumas/markdown-colorcode?style=for-the-badge\n[last-commit-url]: https://github.com/wbaldoumas/markdown-colorcode/commits/main\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwbaldoumas%2Fmarkdown-colorcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwbaldoumas%2Fmarkdown-colorcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwbaldoumas%2Fmarkdown-colorcode/lists"}