docs(schema): ensure every enum variant has a renderable title

This commit is contained in:
LGUG2Z
2025-12-27 20:28:08 -08:00
parent 3a81f7babb
commit f77a303b30
14 changed files with 163 additions and 30 deletions
+8 -2
View File
@@ -571,6 +571,7 @@ impl From<Position> for Pos2 {
/// Komorebi bar theme
pub enum KomobarTheme {
/// Theme from catppuccin-egui
#[cfg_attr(feature = "schemars", schemars(title = "Catppuccin"))]
Catppuccin {
/// Name of the Catppuccin theme (theme previews: https://github.com/catppuccin/catppuccin)
name: komorebi_themes::Catppuccin,
@@ -582,6 +583,7 @@ pub enum KomobarTheme {
auto_select_text: Option<komorebi_themes::CatppuccinValue>,
},
/// Theme from base16-egui-themes
#[cfg_attr(feature = "schemars", schemars(title = "Base16"))]
Base16 {
/// Name of the Base16 theme (theme previews: https://tinted-theming.github.io/tinted-gallery/)
name: komorebi_themes::Base16,
@@ -593,6 +595,7 @@ pub enum KomobarTheme {
auto_select_text: Option<komorebi_themes::Base16Value>,
},
/// Custom Base16 theme
#[cfg_attr(feature = "schemars", schemars(title = "Custom"))]
Custom {
/// Colours of the custom Base16 theme palette
colours: Box<komorebi_themes::Base16ColourPalette>,
@@ -669,9 +672,10 @@ pub enum DisplayFormat {
}
macro_rules! extend_enum {
($existing_enum:ident, $new_enum:ident, { $($(#[$meta:meta])* $variant:ident),* $(,)? }) => {
($(#[$type_meta:meta])* $existing_enum:ident, $new_enum:ident, { $($(#[$meta:meta])* $variant:ident),* $(,)? }) => {
#[derive(Copy, Clone, Debug, serde::Serialize, serde::Deserialize, PartialEq)]
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
$(#[$type_meta])*
pub enum $new_enum {
// Add new variants
$(
@@ -692,7 +696,9 @@ macro_rules! extend_enum {
};
}
extend_enum!(DisplayFormat, WorkspacesDisplayFormat, {
extend_enum!(
/// Workspaces display format
DisplayFormat, WorkspacesDisplayFormat, {
/// Show all icons only
AllIcons,
/// Show both all icons and text