Skip to content

Conversation

@tetrapod00
Copy link
Contributor

@tetrapod00 tetrapod00 commented Oct 18, 2024

Followup to #9989.

The sphinx rubric directive is used in place of real semantic headers in some index pages. This change adds CSS styles that mimic the current real h2 and h3 styles, and applies those to the fake header rubrics.

Only fake-h2 is used in this PR, but fake-h3 will be needed for the changes in #10110.

I followed this stackoverflow answer to implement this.

Current h2 and h3 styles are pulled from https://github.com/readthedocs/sphinx_rtd_theme/blob/7b894f5e7a5053dd35de406bc779020c229f20a9/sphinx_rtd_theme/static/css/theme.css and from:

h1,
h2,
h3,
h4,
h5,
h6,
legend,
.rst-content .toctree-wrapper p.caption {
/* Use the same font as the godotengine.org website. */
font-family: var(--header-font-family);
}

Comparison of Building from Source

Master (after #9989). Note the tiny rubric headers:
firefox_rTpHBXShbg
This PR. Note that headers match the existing h2 style:
firefox_x1FpucX9zv
4.2 (Before #9989):
image

The sphinx rubric directive is used in place of real semantic headers in some index pages.
This change adds CSS styles that mimic the current real h2 and h3 styles, and applies those
to the fake header rubrics.
@mhilbrunner
Copy link
Member

Note to self everyone as discussed on RC: We'll postpone this one post the impending Sphinx update, and see if we can make do without (maybe with this)

@tetrapod00
Copy link
Contributor Author

tetrapod00 commented Nov 2, 2024

With Sphinx updated, I tried out the alternative using the :heading-level: option for the .. rubric:: directive and it seems to work perfectly. So this PR won't need to add custom CSS.

@mhilbrunner
Copy link
Member

Superseded by #10187.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants