mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-04 21:07:21 +00:00
Moved all extension methods into extension blocks (#1155)
This commit is contained in:
1 parent
acc7d09fa2
commit
c0a75f39ac
138 files changed
+5884
-4954
No files matched your search
@@ -2,26 +2,29 @@ namespace AIStudio.Tools.CodeHighlighting;
|
||||
|
||||
public static class CodeTokenKindExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// The CSS class which MudBlazor.Markdown gives this kind of part, so that it takes its color from
|
||||
/// the palette of the theme, just as the languages the library highlights itself.
|
||||
/// </summary>
|
||||
/// <param name="kind">What the part is.</param>
|
||||
/// <returns>The CSS class of the part.</returns>
|
||||
public static string ToCssClass(this CodeTokenKind kind) => kind switch
|
||||
extension(CodeTokenKind kind)
|
||||
{
|
||||
CodeTokenKind.KEYWORD => "hljs-keyword",
|
||||
CodeTokenKind.TYPE => "hljs-type",
|
||||
CodeTokenKind.LITERAL => "hljs-literal",
|
||||
CodeTokenKind.STRING => "hljs-string",
|
||||
CodeTokenKind.COMMENT => "hljs-comment",
|
||||
CodeTokenKind.NUMBER => "hljs-number",
|
||||
CodeTokenKind.FUNCTION => "hljs-title function_",
|
||||
CodeTokenKind.META => "hljs-meta",
|
||||
CodeTokenKind.VARIABLE => "hljs-variable",
|
||||
CodeTokenKind.ATTRIBUTE => "hljs-attr",
|
||||
CodeTokenKind.SELECTOR => "hljs-selector-class",
|
||||
/// <summary>
|
||||
/// The CSS class which MudBlazor.Markdown gives this kind of part, so that it takes its color from
|
||||
/// the palette of the theme, just as the languages the library highlights itself.
|
||||
/// </summary>
|
||||
/// <returns>The CSS class of the part.</returns>
|
||||
public string ToCssClass() => kind switch
|
||||
{
|
||||
CodeTokenKind.KEYWORD => "hljs-keyword",
|
||||
CodeTokenKind.TYPE => "hljs-type",
|
||||
CodeTokenKind.LITERAL => "hljs-literal",
|
||||
CodeTokenKind.STRING => "hljs-string",
|
||||
CodeTokenKind.COMMENT => "hljs-comment",
|
||||
CodeTokenKind.NUMBER => "hljs-number",
|
||||
CodeTokenKind.FUNCTION => "hljs-title function_",
|
||||
CodeTokenKind.META => "hljs-meta",
|
||||
CodeTokenKind.VARIABLE => "hljs-variable",
|
||||
CodeTokenKind.ATTRIBUTE => "hljs-attr",
|
||||
CodeTokenKind.SELECTOR => "hljs-selector-class",
|
||||
|
||||
_ => string.Empty,
|
||||
};
|
||||
_ => string.Empty,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user