Highlighted code blocks inside the app (#1153)

This commit is contained in:
Thorsten Sommer authored and GitHub committed 2026-11-04 07:58:57 +01:00
1 parent 0b42c0288e
commit f4a86c2fb8
60 files changed
+2550 -41

No files matched your search

+11 -2
View File
@@ -173,9 +173,18 @@ internal sealed class Program
config.PopoverOptions.ModalOverlay = true;
});
builder.Services.AddMemoryCache(); // Needed for the Markdown library
builder.Services.AddMudMarkdownServices();
builder.Services.AddSingleton(new MudTheme());
//
// Code blocks in Markdown take their colors from the palettes, see MudMarkdownThemeProvider in the
// main layout. Their backgrounds stay those of the code blocks before, so that a code block still
// stands out against a white card:
//
builder.Services.AddSingleton(new MudTheme
{
PaletteLight = new MudMarkdownPaletteLight { CodeHighlight = MudCodeHighlightThemes.Light.LightPlus with { Background = "#F0F0F0" } },
PaletteDark = new MudMarkdownPaletteDark { CodeHighlight = MudCodeHighlightThemes.Dark.DarkPlus with { Background = "#444444" } },
});
builder.Services.AddSingleton(MessageBus.INSTANCE);
builder.Services.AddSingleton(rust);
builder.Services.AddSingleton(typeof(RuntimeInfoResponse), runtimeInfo);