README

bobzhang/beautiful_mermaid/themes/core does not have a README file

#
ShikiTheme

pub(all) struct ShikiTheme {
theme_type : String?
colors : Map[String, String]?
token_colors : Array[ShikiTokenColor]?
}

Simplified Shiki-like theme model used to derive DiagramColors.
impl Eq for ShikiTheme
impl Show for ShikiTheme

#
ShikiTokenColor

pub(all) struct ShikiTokenColor {
scopes : Array[String]
foreground : String?
}

Minimal Shiki token color model used by from_shiki_theme.

#
ThemeName

pub enum ThemeName {
ZincLight
ZincDark
TokyoNight
TokyoNightStorm
TokyoNightLight
CatppuccinMocha
CatppuccinLatte
Nord
NordLight
Dracula
GithubLight
GithubDark
SolarizedLight
SolarizedDark
OneDark
}

Built-in theme identifiers for render_mermaid_with_theme.
impl Eq for ThemeName
impl Show for ThemeName
impl ToJson for ThemeName

#
built_in_theme_colors

Return a slug-to-colors map for all built-in themes.

#
built_in_theme_slugs

fn built_in_theme_slugs() -> Array[String]

Return canonical slugs for all built-in themes.

#
built_in_theme_slugs_csv

fn built_in_theme_slugs_csv() -> String

Return built-in theme slugs as a comma-separated string.

#
built_in_themes

fn built_in_themes() -> Array[ThemeName]

Return all built-in themes in stable display order.

#
canonical_theme_slug

fn canonical_theme_slug(name : String) -> String?

Return the canonical slug for a user theme name, if it resolves.

#
from_shiki_theme

Convert editor-like theme data to diagram colors. Falls back to sensible light/dark defaults when fields are missing.

#
normalize_theme_name

fn normalize_theme_name(name : String) -> String

Normalize user theme input: lowercase, spaces/underscores to -, collapse repeated separators.

#
parse_theme_name

fn parse_theme_name(name : String) -> ThemeName?

Parse a user-supplied theme name to a ThemeName. Accepts default as an alias for zinc-light.

Example

test {
match parse_theme_name("TOKYO NIGHT") {
Some(theme) => assert_eq(theme_slug(theme), "tokyo-night")
None => fail("theme should parse")
}
match parse_theme_name("default") {
Some(theme) => assert_eq(theme_slug(theme), "zinc-light")
None => fail("default should parse")
}
assert_true(parse_theme_name("not-a-theme") is None)
}

#
shiki_dark_theme

fn shiki_dark_theme(colors : Map[String, String]?, token_colors : Array[ShikiTokenColor]?) -> ShikiTheme

Build a dark ShikiTheme.

#
shiki_light_theme

fn shiki_light_theme(colors : Map[String, String]?, token_colors : Array[ShikiTokenColor]?) -> ShikiTheme

Build a light ShikiTheme.

#
shiki_theme

fn shiki_theme(theme_type : String?, colors : Map[String, String]?, token_colors : Array[ShikiTokenColor]?) -> ShikiTheme

Build a ShikiTheme value.

#
shiki_token_color

fn shiki_token_color(scope : String, foreground : String?) -> ShikiTokenColor

Helper to construct a token-color entry for one scope.

#
shiki_token_color_many

fn shiki_token_color_many(scopes : Array[String], foreground : String?) -> ShikiTokenColor

Helper to construct a token-color entry for multiple scopes.

#
theme_by_name

Resolve a user theme name directly to colors.

Example

test {
match theme_by_name("github-dark") {
Some(colors) => assert_eq(colors.bg, "#0d1117")
None => fail("theme should resolve")
}
}

#
theme_colors

Return the color palette for a built-in theme.

#
theme_exists

fn theme_exists(name : String) -> Bool

Return whether a user theme name resolves to a known built-in theme.

#
theme_slug

fn theme_slug(theme : ThemeName) -> String

Return the canonical slug for a built-in theme.

Powered by MoonBit

Site sourceReport issuePackagesBuild queueSkillsStatistics

© 2026 mooncakes.io