Skip to content

Commit 3df379c

Browse files
committed
Refactor formatting and remove unused import
Reformatted code for better readability in docs/conf.py and sphinx_togglebutton/__init__.py by expanding lists and function calls over multiple lines. Removed unused 'os' import from setup.py.
1 parent 935deac commit 3df379c

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

docs/conf.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111

1212

1313
# -- General configuration ---------------------------------------------------
14-
extensions = ["myst_nb", "sphinx_examples", "sphinx_design", "sphinx_togglebutton"]
14+
extensions = [
15+
"myst_nb",
16+
"sphinx_examples",
17+
"sphinx_design",
18+
"sphinx_togglebutton",
19+
]
1520
templates_path = ["_templates"]
1621
source_suffix = ".rst"
1722
main_doc = "index"

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import os
21
from pathlib import Path
32

43
from setuptools import find_packages, setup

sphinx_togglebutton/__init__.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,18 @@
1313

1414

1515
def st_static_path(app):
16-
static_path = os.path.abspath(os.path.join(os.path.dirname(__file__), "_static"))
16+
static_path = os.path.abspath(
17+
os.path.join(os.path.dirname(__file__), "_static")
18+
)
1719
app.config.html_static_path.append(static_path)
1820

1921

2022
def initialize_js_assets(app, config):
2123
# Update the global context
2224

23-
app.add_js_file(None, body=f"let toggleHintShow = '{config.togglebutton_hint}';")
25+
app.add_js_file(
26+
None, body=f"let toggleHintShow = '{config.togglebutton_hint}';"
27+
)
2428
app.add_js_file(
2529
None, body=f"let toggleHintHide = '{config.togglebutton_hint_hide}';"
2630
)
@@ -83,7 +87,9 @@ def setup(app):
8387
app.add_config_value(
8488
"togglebutton_selector", ".toggle, .admonition.dropdown", "html"
8589
)
86-
app.add_config_value("togglebutton_hint", f"{translate('Click to show')}", "html")
90+
app.add_config_value(
91+
"togglebutton_hint", f"{translate('Click to show')}", "html"
92+
)
8793
app.add_config_value(
8894
"togglebutton_hint_hide", f"{translate('Click to hide')}", "html"
8995
)

0 commit comments

Comments
 (0)