sphinx-doc / alabaster

Lightweight, configurable Sphinx theme
http://alabaster.readthedocs.io/
Other
734 stars 186 forks source link

[FEATURE] ``show_powered_by`` should be updatable using Sphinx ``html_show_sphinx`` option. #205

Closed picnixz closed 9 months ago

picnixz commented 1 year ago

(cc: @AA-Turner)

In light of #172 and https://github.com/sphinx-doc/sphinx/issues/11367, the alabaster theme uses another configuration value than what the basic theme is using when deciding whether "Powered by Sphinx" should be shown or not:

https://github.com/sphinx-doc/alabaster/blob/7a9df17b6366c96baba6bf5e14f9b6ff6bf7defa/alabaster/layout.html#L90

In Sphinx, the flag value can be changed using html_show_sphinx, but the value is not forwarded to the theme, thereby leaving the default value:

https://github.com/sphinx-doc/alabaster/blob/7a9df17b6366c96baba6bf5e14f9b6ff6bf7defa/alabaster/theme.conf#L31

Since renaming this default value may lead to breaking existing projects (I don't know when this was changed), I suggest extending these lines:

https://github.com/sphinx-doc/alabaster/blob/7a9df17b6366c96baba6bf5e14f9b6ff6bf7defa/alabaster/__init__.py#L15-L16

with

# the default value of 'theme_show_powered_by' is 'true', so we keep the same
# type conventions (at least that would help for debugging the context I think)
context['theme_show_powered_by'] = 'true' if context['show_sphinx'] else 'false'

Similarly, I would suggest changing the current layout.html and emit a deprecation warning (maybe?) concerning html_show_powered_by.