Open johnW-ret opened 1 month ago
@johnW-ret thanks for your interest in Markdown.ColorCode and for opening this issue. This is similar to https://github.com/wbaldoumas/markdown-colorcode/issues/116.
The idea behind HtmlFormatterType.Css
is to allow users of this library to customize their syntax coloring using their own CSS files. Rather than forcing the output of HtmlClassFormatter.GetCSSString into the generated HTML, users should specify their own CSS styling.
You can find (and use as-is or customize) the default CSS needed for HtmlFormatterType.Css
here.
As a follow up, is there a documentation improvement that can be made that would make this more obvious?
Automatically marking issue as stale due to lack of activity
Problem Statement
Currently,
outputs HTML of the sort:
To actually get styling, you need the CSS code from
HtmlClassFormatter.GetCSSString
fromColorCode
.Forgive me if I just misunderstand the code, but this library never calls
HtmlClassFormatter.GetCSSString
andHtmlClassFormatter
is only stored as aprivate readonly
field in asealed
class, so there is currently no way to get ths CSS styling out of this library.Proposed Solution
CSS should be placed in an inline
style
tag next to the rendered HTML.Alternatives Considered
The aforementioned solution would cause style duplication (?), but it's also the simplest solution that works.