themeconfig
Class info¶
Classes¶
Name | Children | Inherits |
---|---|---|
ThemeConfig mkdocs_mknodes.appconfig.themeconfig Configuration settings for the MkDocs themes. |
🛈 DocStrings¶
Pydantic types for universal_pathlib (upath.UPath) with validation capabilities.
This module provides a Pydantic-compatible type for upath.UPath, offering similar functionality to Pydantic's built-in Path type. It includes validators for existence checks and path type verification.
Example
from pydantic import BaseModel
class Config(BaseModel):
input_file: UPathFile
output_dir: UPathDir
temp_path: UPath
# Usage
config = Config(
input_file="data.csv",
output_dir="output",
temp_path="temp/workspace"
)
ThemeConfig
¶
Bases: BaseModel
Configuration settings for the MkDocs themes.
Theme Configuration Options
The theme configuration allows for extensive customization including custom directories, static templates, and locale settings.
Properties Overview¶
Property | Description | Required |
---|---|---|
name | Theme identifier | Yes |
custom_dir | Custom theme directory | No |
static_templates | Additional static pages | No |
locale | Language/locale setting | No |
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
|
'material'
|
custom_dir
|
str | None
|
|
None
|
static_templates
|
list[str] | None
|
|
[]
|
locale
|
str | None
|
|
'en'
|
Source code in mkdocs_mknodes/appconfig/themeconfig.py
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
|
custom_dir
class-attribute
instance-attribute
¶
custom_dir: str | None = Field(None)
Directory containing custom theme overrides or extensions.
Theme Customization
Use this to override or extend the selected theme's templates and assets.
Custom Directory Setup
theme:
name: material
custom_dir: custom_theme/
locale
class-attribute
instance-attribute
¶
locale: str | None = Field('en')
Defines the language and regional settings for the theme.
Locale Impact
Affects: - Date formats - UI text translations - RTL/LTR text direction
Locale Setting
theme:
name: material
locale: en_US
Common Locales
en_US
: English (United States)fr_FR
: French (France)de_DE
: German (Germany)ja_JP
: Japanese (Japan)
name
class-attribute
instance-attribute
¶
name: str = Field('material')
Specifies the theme to use for documentation rendering.
Common Theme Options
material
: Material for MkDocs thememkdocs
: Default MkDocs themereadthedocs
: ReadTheDocs theme
Basic Configuration
theme:
name: material
static_templates
class-attribute
instance-attribute
¶
Defines templates to be rendered as static pages, regardless of nav structure.
Common Use Cases
- Error pages (404, 500)
- Sitemaps
- Custom static pages
Static Templates Configuration
theme:
name: material
static_templates:
- sitemap.html
- 404.html
- custom_page.html