sphinx-doc/alabaster

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

picnixz opened this issue · 0 comments

(cc: @AA-Turner)

In light of #172 and sphinx-doc/sphinx#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:

{% if theme_show_powered_by|lower == 'true' %}

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:

show_powered_by = true

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

def update_context(app, pagename, templatename, context, doctree):
context["alabaster_version"] = __version__

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.