Classes
FeatureFlags
dataclass
Feature flags configuration.
Features are organized by category (navigation, content, etc.) and ca…
FeatureFlags
dataclass Feature flags configuration.
Features are organized by category (navigation, content, etc.) and can be enabled/disabled individually. Each feature can have a description for documentation purposes.
Attributes
| Name | Type | Description |
|---|---|---|
navigation |
dict[str, bool] |
|
content |
dict[str, bool] |
|
search |
dict[str, bool] |
|
header |
dict[str, bool] |
|
footer |
dict[str, bool] |
|
accessibility |
dict[str, bool] |
Methods 3
get_enabled_features
Get list of all enabled feature keys in dotted notation.
get_enabled_features
def get_enabled_features(self) -> list[str]
Get list of all enabled feature keys in dotted notation.
Returns
List of feature keys like ["navigation.toc", "content.code.copy"]list[str]
—
has_feature
Check if a feature is enabled.
has_feature
def has_feature(self, feature: str) -> bool
Check if a feature is enabled.
Parameters 1
feature |
str |
Feature key in dotted notation (e.g., "navigation.toc") |
Returns
True if feature is enabledbool
—
from_dict
classmethod
Create FeatureFlags from dictionary.
from_dict
classmethod def from_dict(cls, data: dict[str, Any]) -> FeatureFlags
Create FeatureFlags from dictionary.
Parameters 1
data |
dict[str, Any] |
Dictionary with feature flags organized by category |
Returns
FeatureFlags instanceFeatureFlags
—
AppearanceConfig
dataclass
Appearance configuration (theme mode and palette).
Controls default appearance mode (light/dark/sy…
AppearanceConfig
dataclass Appearance configuration (theme mode and palette).
Controls default appearance mode (light/dark/system) and color palette.
Attributes
| Name | Type | Description |
|---|---|---|
default_mode |
str |
|
default_palette |
str |
Methods 1
from_dict
classmethod
Create AppearanceConfig from dictionary.
from_dict
classmethod def from_dict(cls, data: dict[str, Any]) -> AppearanceConfig
Create AppearanceConfig from dictionary.
Parameters 1
data |
dict[str, Any] |
Dictionary with appearance settings |
Returns
AppearanceConfig instanceAppearanceConfig
—
Internal Methods 1
__post_init__
Validate appearance configuration.
__post_init__
def __post_init__(self) -> None
Validate appearance configuration.
IconConfig
dataclass
Icon configuration (library and aliases).
Controls which icon library is used and provides semanti…
IconConfig
dataclass Icon configuration (library and aliases).
Controls which icon library is used and provides semantic name aliases for icon names (e.g., "search" -> "magnifying-glass").
Attributes
| Name | Type | Description |
|---|---|---|
library |
str |
|
aliases |
dict[str, str] |
|
defaults |
dict[str, str] |
Methods 2
from_dict
classmethod
Create IconConfig from dictionary.
from_dict
classmethod def from_dict(cls, data: dict[str, Any]) -> IconConfig
Create IconConfig from dictionary.
Parameters 1
data |
dict[str, Any] |
Dictionary with icon settings |
Returns
IconConfig instanceIconConfig
—
to_dict
Convert IconConfig to dictionary.
to_dict
def to_dict(self) -> dict[str, Any]
Convert IconConfig to dictionary.
Returns
Dictionary representationdict[str, Any]
—
ThemeConfig
dataclass
Complete theme configuration loaded from theme.yaml.
Consolidates all theme settings (features, ap…
ThemeConfig
dataclass Complete theme configuration loaded from theme.yaml.
Consolidates all theme settings (features, appearance, icons) into a single configuration object that can be loaded from YAML.
Attributes
| Name | Type | Description |
|---|---|---|
name |
str |
|
version |
str |
|
parent |
str | None |
|
features |
FeatureFlags |
|
appearance |
AppearanceConfig |
|
icons |
IconConfig |
Methods 2
load
classmethod
Load theme configuration from theme.yaml file.
load
classmethod def load(cls, theme_path: Path) -> ThemeConfig
Load theme configuration from theme.yaml file.
Parameters 1
theme_path |
Path |
Path to theme directory (will look for theme.yaml) |
Returns
ThemeConfig instance loaded from YAMLThemeConfig
—
to_dict
Convert ThemeConfig to dictionary for serialization.
to_dict
def to_dict(self) -> dict[str, Any]
Convert ThemeConfig to dictionary for serialization.
Returns
Dictionary representation suitable for YAML exportdict[str, Any]
—