Skip to content

Commit

Permalink
Add global to global configuration var names
Browse files Browse the repository at this point in the history
  • Loading branch information
steppi committed Oct 20, 2023
1 parent 7a659c3 commit 6b9ec71
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions jupyterlite_sphinx/jupyterlite_sphinx.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ def run(self):

# Allow css for button to be specified in conf.py
config = self.state.document.settings.env.config
try_examples_button_css = config.try_examples_button_css
try_examples_button_css = config.try_examples_global_button_css

try_examples_button_css = f".try_examples_button {{{try_examples_button_css}}}"
style_tag = nodes.raw(
Expand All @@ -483,8 +483,8 @@ def _process_docstring_examples(app, docname, source):

def _process_autodoc_docstrings(app, what, name, obj, options, lines):
try_examples_options = {
"toolbar": app.config.try_examples_toolbar,
"theme": app.config.try_examples_theme,
"toolbar": app.config.try_examples_global_toolbar,
"theme": app.config.try_examples_global_theme,
}
try_examples_options = {
key: value for key, value in try_examples_options.items() if value is not None
Expand Down Expand Up @@ -593,16 +593,16 @@ def setup(app):
app.add_config_value("jupyterlite_contents", None, rebuild="html")
app.add_config_value("jupyterlite_bind_ipynb_suffix", True, rebuild="html")
app.add_config_value(
"try_examples_button_css", default="float: right;", rebuild="html"
"global_enable_try_examples", default=False, rebuild=True
)
app.add_config_value(
"global_enable_try_examples", default=False, rebuild=True
"try_examples_global_button_css", default="float: right;", rebuild="html"
)
app.add_config_value(
"try_examples_toolbar", default=None, rebuild=True
"try_examples_global_toolbar", default=None, rebuild=True
)
app.add_config_value(
"try_examples_theme", default=None, rebuild=True
"try_examples_global_theme", default=None, rebuild=True
)


Expand Down

0 comments on commit 6b9ec71

Please sign in to comment.