Restore the contrasting version in the docs title - #157
Merged
timkpaine merged 1 commit intoSep 17, 2026
Merged
Conversation
Themes reuse html_title for the <title> tag, which is why the styled version span was dropped in 2d69e4a: the markup showed up escaped in browser tabs. Add HtmlTitle, a str whose __html__ returns the tag-stripped text. Sphinx renders docstitle raw in the theme header but pipes it through |e or |striptags|e for <title>, and both filters go via __html__, so one value gives markup in the header and plain text in the tab. html_title itself stays a plain str, since check_confval_types compares type(value) exactly and rejects str subclasses, and a class defined in the generated conf.py cannot be pickled with the build environment. The styled form is injected as context["docstitle"] instead, skipping the search page, which is the one template that interpolates docstitle unfiltered.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #157 +/- ##
==========================================
- Coverage 86.22% 86.20% -0.03%
==========================================
Files 16 16
Lines 2026 2030 +4
Branches 209 209
==========================================
+ Hits 1747 1750 +3
- Misses 217 218 +1
Partials 62 62 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
timkpaine
merged commit Sep 17, 2026
55bcda3
into
python-project-templates:main
1 of 3 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Themes reuse html_title for the <title> tag, which is why the styled version span was dropped in 2d69e4a: the markup showed up escaped in browser tabs.
Add HtmlTitle, a str whose html returns the tag-stripped text. Sphinx renders docstitle raw in the theme header but pipes it through |e or |striptags|e for <title>, and both filters go via html, so one value gives markup in the header and plain text in the tab.
html_title itself stays a plain str, since check_confval_types compares type(value) exactly and rejects str subclasses, and a class defined in the generated conf.py cannot be pickled with the build environment. The styled form is injected as context["docstitle"] instead, skipping the search page, which is the one template that interpolates docstitle unfiltered.