Functions
check_deprecated_keys
Check for deprecated config keys and optionally warn.
check_deprecated_keys
def check_deprecated_keys(config: dict[str, Any], source: str = 'configuration', warn: bool = True) -> list[tuple[str, str, str]]
Check for deprecated config keys and optionally warn.
Parameters 3
| Name | Type | Default | Description |
|---|---|---|---|
config |
dict[str, Any] |
— | Configuration dictionary to check |
source |
str |
'configuration' |
Source description for log messages (e.g., "bengal.toml") |
warn |
bool |
True |
Whether to emit warnings (default: True) |
Returns
List of (old_key, new_location, migration_note) tuples for deprecated keys foundlist[tuple[str, str, str]]
—
print_deprecation_warnings
Print user-friendly deprecation warnings.
print_deprecation_warnings
def print_deprecation_warnings(deprecated: list[tuple[str, str, str]], source: str = 'configuration') -> None
Print user-friendly deprecation warnings.
Parameters 2
| Name | Type | Default | Description |
|---|---|---|---|
deprecated |
list[tuple[str, str, str]] |
— | List of (old_key, new_location, note) from check_deprecated_keys() |
source |
str |
'configuration' |
Source description for context Example output: ⚠️ Deprecated config keys in bengal.toml: • minify_assets → assets.minify Use 'assets.minify: true' instead of 'minify_assets: true' • generate_sitemap → features.sitemap Use 'features.sitemap: true' instead of 'generate_sitemap: true' These keys still work but will be removed in a future version. |
migrate_deprecated_keys
Migrate deprecated keys to their new locations.
This function moves values from deprecated flat ke…
migrate_deprecated_keys
def migrate_deprecated_keys(config: dict[str, Any], in_place: bool = False) -> dict[str, Any]
Migrate deprecated keys to their new locations.
This function moves values from deprecated flat keys to their new nested locations. The original keys are preserved for backward compatibility unless in_place=True.
Parameters 2
| Name | Type | Default | Description |
|---|---|---|---|
config |
dict[str, Any] |
— | Configuration dictionary |
in_place |
bool |
False |
If True, remove old keys after migration |
Returns
Updated configuration dictionarydict[str, Any]
—
get_deprecation_summary
Get a summary of all deprecated keys for documentation.
get_deprecation_summary
def get_deprecation_summary() -> str
Get a summary of all deprecated keys for documentation.
Returns
Markdown-formatted summary of deprecated keysstr
—