Source code for jsoncrack_for_sphinx.config.config_values
"""Configuration value extraction utilities."""fromtypingimportAny,Dictfrom..utils.typesimportRenderMode,Themefrom.config_mainimportJsonCrackConfig
[docs]defget_config_values(config:JsonCrackConfig)->Dict[str,Any]:"""Extract configuration values for HTML generation."""# Get render mode settingsrender_mode=config.render.mode.modeonscreen_threshold=0.1onscreen_margin="50px"# Only get threshold and margin for OnScreen modeifisinstance(config.render.mode,RenderMode.OnScreen):onscreen_threshold=config.render.mode.thresholdonscreen_margin=config.render.mode.margin# Get theme valuetheme_value=config.theme.valueifconfig.theme!=Theme.AUTOelseNonereturn{"render_mode":render_mode,"theme":theme_value,"direction":config.container.direction.value,"height":config.container.height,"width":config.container.width,"onscreen_threshold":onscreen_threshold,"onscreen_margin":onscreen_margin,}