Functions
generate_menu_config
Generate menu configuration entries for given sections.
Creates [[menu.main]] entries with appropr…
generate_menu_config
def generate_menu_config(sections: list[str], menu_name: str = 'main') -> str
Generate menu configuration entries for given sections.
Creates [[menu.main]] entries with appropriate weights based on common conventions (Home first, then other sections in order).
Parameters 2
| Name | Type | Default | Description |
|---|---|---|---|
sections |
list[str] |
— | List of section slugs (e.g., ['blog', 'about', 'projects']) |
menu_name |
str |
'main' |
Menu identifier (default: 'main') |
Returns
TOML-formatted menu configuration stringstr
—
_get_display_name
Convert section slug to display name.
Uses intelligent title-casing with special handling for
comm…
_get_display_name
def _get_display_name(section_slug: str) -> str
Convert section slug to display name.
Uses intelligent title-casing with special handling for common terms and acronyms.
Parameters 1
| Name | Type | Default | Description |
|---|---|---|---|
section_slug |
str |
— | Section slug (e.g., 'getting-started', 'api') |
Returns
Display name (e.g., 'Getting Started', 'API')str
—
append_menu_to_config
Append menu configuration to existing bengal.toml file.
Safely appends menu entries to the config …
append_menu_to_config
def append_menu_to_config(config_path: Path, sections: list[str], menu_name: str = 'main') -> bool
Append menu configuration to existing bengal.toml file.
Safely appends menu entries to the config file, checking if menu configuration already exists to avoid duplicates.
Parameters 3
| Name | Type | Default | Description |
|---|---|---|---|
config_path |
Path |
— | Path to bengal.toml |
sections |
list[str] |
— | List of section slugs to add |
menu_name |
str |
'main' |
Menu identifier (default: 'main') |
Returns
True if menu was added, False if menu already existsbool
—
get_menu_suggestions
Get menu configuration suggestions for display to user.
Returns structured menu data that can be u…
get_menu_suggestions
def get_menu_suggestions(sections: list[str], menu_name: str = 'main') -> dict[str, Any]
Get menu configuration suggestions for display to user.
Returns structured menu data that can be used for:
- CLI display/preview
- Interactive prompts
- Configuration generation
Parameters 2
| Name | Type | Default | Description |
|---|---|---|---|
sections |
list[str] |
— | List of section slugs |
menu_name |
str |
'main' |
Menu identifier (default: 'main') |
Returns
Dictionary with menu items and TOML representationdict[str, Any]
—