We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tippy-header
We want to change the font size of the different headers in the tips but only the first header of the excerpt has the tippy-header class added to it.
The cause appears to be in the _get_header_html() function line 470
_get_header_html()
output += _get_header_html(sub_header, False)
In its context:
def _get_header_html(header: Tag | NavigableString, _start: bool = True) -> str: """Get the HTML for a header tag, including itself and some following content.""" if not _start or not isinstance(header, Tag): output = str(header) else: header_copy = header.__copy__() header_copy["style"] = "margin-top: 0;" # add a class if "class" in header_copy.attrs: header_copy["class"].append("tippy-header") # type: ignore[union-attr] else: header_copy["class"] = ["tippy-header"] output = str(header_copy) for sibling in header.next_siblings: if not isinstance(sibling, Tag): continue if sibling.name == "section": if sub_header := sibling.find(["h1", "h2", "h3", "h4", "h5", "h6"]): output += _get_header_html(sub_header, False) break if sibling.name == "p": output += str(sibling) if (next_sibling := next_sibling_tag(sibling)) and next_sibling.name == "p": output += str(next_sibling) break return output
If the False is replaced by True the tippy-header class is added to each header level.
False
True
Line 470 becomes:
output += _get_header_html(sub_header, True)
Where in the source file: https://github.com/sphinx-extensions2/sphinx-tippy/blob/17770ce8f641b844f83d09624a388cdfca374531/src/sphinx_tippy.py#L452C5-L477C21
The text was updated successfully, but these errors were encountered:
_get_header_html
No branches or pull requests
We want to change the font size of the different headers in the tips but only the first header of the excerpt has the
tippy-header
class added to it.The cause appears to be in the
_get_header_html()
function line 470In its context:
If the
False
is replaced byTrue
thetippy-header
class is added to each header level.Line 470 becomes:
Where in the source file: https://github.com/sphinx-extensions2/sphinx-tippy/blob/17770ce8f641b844f83d09624a388cdfca374531/src/sphinx_tippy.py#L452C5-L477C21
The text was updated successfully, but these errors were encountered: