HTML IDs

Centralized HTML ID constants for settings components

This class extends AppHtmlIds from cjm_fasthtml_app_core with settings-specific IDs.

Inherited from AppHtmlIds: - ALERT_CONTAINER: “alert-container” - MAIN_CONTENT: “main-content” - as_selector(id_str): Converts an ID to CSS selector format (with #)

For IDE Support: IDEs like VS Code with Pylance will autocomplete these attributes and warn if you try to access non-existent attributes.

Note: The typing.Final annotation indicates these are constants that shouldn’t be reassigned at runtime.


source

SettingsHtmlIds

 SettingsHtmlIds ()

HTML ID constants for settings components.

# Example usage
print(f"Settings content ID: {SettingsHtmlIds.SETTINGS_CONTENT}")
print(f"As selector: {SettingsHtmlIds.as_selector(SettingsHtmlIds.SETTINGS_CONTENT)}")
print(f"Menu item for 'general': {SettingsHtmlIds.menu_item('general')}")
print(f"Alert container (inherited): {SettingsHtmlIds.ALERT_CONTAINER}")
Settings content ID: settings-content
As selector: #settings-content
Menu item for 'general': menu-item-general
Alert container (inherited): alert-container
# Example: SettingsHtmlIds inherits from AppHtmlIds
print(f"Inherited MAIN_CONTENT ID: {SettingsHtmlIds.MAIN_CONTENT}")
print(f"Inherited ALERT_CONTAINER: {SettingsHtmlIds.ALERT_CONTAINER}")
print(f"Settings-specific SETTINGS_CONTENT: {SettingsHtmlIds.SETTINGS_CONTENT}")
print(f"As selector (inherited method): {SettingsHtmlIds.as_selector(SettingsHtmlIds.SETTINGS_SIDEBAR)}")
Inherited MAIN_CONTENT ID: main-content
Inherited ALERT_CONTAINER: alert-container
Settings-specific SETTINGS_CONTENT: settings-content
As selector (inherited method): #settings-sidebar