Skip to content

Commit

Permalink
remove singlehtml_sidebars shim (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidism authored Oct 16, 2024
2 parents 9b0a80a + ae2a56d commit 8bbfe0f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 21 deletions.
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Unreleased
versions are no longer required for the banner to be correct. :pr:`117`
- Generate 404 page using the sphinx-notfound-page extension. This fixes the
URLs when the page is hosted so that it loads the CSS. :issue:`34`
- Remove handling for ``singlehtml_sidebars`` config which predated Sphinx's
support. :pr:`119`


Version 2.1.3
Expand Down
21 changes: 0 additions & 21 deletions src/pallets_sphinx_themes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

from sphinx.application import Sphinx
from sphinx.builders.dirhtml import DirectoryHTMLBuilder
from sphinx.builders.singlehtml import SingleFileHTMLBuilder
from sphinx.errors import ExtensionError

from .theme_check import only_pallets_theme
Expand Down Expand Up @@ -55,13 +54,6 @@ def setup(app):
except ExtensionError:
pass

try:
app.add_config_value("singlehtml_sidebars", None, "html")
except ExtensionError:
pass
else:
app.connect("builder-inited", singlehtml_sidebars)

from .themes import click as click_ext
from .themes import jinja as jinja_ext

Expand Down Expand Up @@ -124,19 +116,6 @@ def canonical_url(app: Sphinx, pagename, templatename, context, doctree):
context["pageurl"] = base + target


@only_pallets_theme()
def singlehtml_sidebars(app):
"""When using a ``singlehtml`` builder, replace the
``html_sidebars`` config with ``singlehtml_sidebars``. This can be
used to change what sidebars are rendered for the single page called
``"index"`` by the builder.
"""
if app.config.singlehtml_sidebars is not None and isinstance(
app.builder, SingleFileHTMLBuilder
):
app.config.html_sidebars = app.config.singlehtml_sidebars


@only_pallets_theme()
def skip_internal(app, what, name, obj, skip, options):
"""Skip rendering autodoc when the docstring contains a line with
Expand Down

0 comments on commit 8bbfe0f

Please sign in to comment.