@@ -61,10 +61,10 @@ def copy_asset_files(app, exception):
61
61
if exception is None : # build succeeded
62
62
63
63
context = {}
64
- for attr in app .config .values :
64
+ for attr , opt in app .config .values . items () :
65
65
if attr .startswith ('hoverxref_' ):
66
66
# First, add the default values to the context
67
- context [attr ] = app . config . values [ attr ] [0 ]
67
+ context [attr ] = opt . default if hasattr ( opt , "default" ) else opt [0 ]
68
68
69
69
for attr in dir (app .config ):
70
70
if attr .startswith ('hoverxref_' ):
@@ -264,7 +264,8 @@ def setup_theme(app, exception):
264
264
"""
265
265
css_file = None
266
266
theme = app .config .html_theme
267
- default , rebuild , types = app .config .values .get ('hoverxref_modal_class' )
267
+ opt = app .config .values ['hoverxref_modal_class' ]
268
+ default = opt .default if hasattr (opt , "default" ) else opt [0 ]
268
269
if theme == 'sphinx_material' :
269
270
if app .config .hoverxref_modal_class == default :
270
271
app .config .hoverxref_modal_class = 'md-typeset'
@@ -296,8 +297,8 @@ def setup_assets_policy(app, exception):
296
297
297
298
def deprecated_configs_warning (app , exception ):
298
299
"""Log warning message if old configs are used."""
299
- default , rebuild , types = app .config .values . get ( 'hoverxref_tooltip_api_host' )
300
- if app .config .hoverxref_tooltip_api_host != default :
300
+ opt = app .config .values [ 'hoverxref_tooltip_api_host' ]
301
+ if app .config .hoverxref_tooltip_api_host != ( opt . default if hasattr ( opt , "default" ) else opt [ 0 ]) :
301
302
message = '"hoverxref_tooltip_api_host" is deprecated and replaced by "hoverxref_api_host".'
302
303
logger .warning (message )
303
304
app .config .hoverxref_api_host = app .config .hoverxref_tooltip_api_host
0 commit comments