readthedocs / sphinx_rtd_theme

Sphinx theme from Read the Docs
https://sphinx-rtd-theme.readthedocs.io/
MIT License
4.81k stars 1.74k forks source link

Specifying pygments_style in conf.py doesn't work #1496

Closed rht closed 3 months ago

rht commented 1 year ago

Problem

I tried to change the pygments_style in my project: https://github.com/projectmesa/mesa/pull/1719. I have waited for #1463 so that I can use Sphinx 7.

However, the build still uses the default sphinx pygments_style: https://mesa--1719.org.readthedocs.build/en/1719/useful-snippets/snippets.html.

Any idea what went wrong and how to fix it? The project has existed before 2019, and so https://blog.readthedocs.com/python-core-requirements-changed/ doesn't affect it.

humitos commented 3 months ago

I just checked this in our code at https://github.com/readthedocs/sphinx_rtd_theme/blob/master/sphinx_rtd_theme/theme.conf#L4 and it seems we are defining it properly as it's said in the Sphinx's documentation at https://www.sphinx-doc.org/en/master/development/html_themes/index.html#theme-configuration-theme-conf

Are you still having this issue?

rht commented 3 months ago

Yes, the issue still exists. I have the gruvbox-dark in the config as per https://github.com/projectmesa/mesa/blob/c96ee458ca480c786802587fa4e8d0d997b4de95/docs/conf.py#L106, but the latest main still doesn't show a gruvbox-looking theme in the code: https://mesa.readthedocs.io/en/latest/howto.html.

humitos commented 3 months ago

The link you shared, https://mesa.readthedocs.io/en/latest/howto.html, is using PyData Theme, not Read the Docs Sphinx Theme. You can check the docs for PyData Theme at https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/styling.html#configure-pygments-theme

rht commented 3 months ago

I see, thank you for the lead. I will try right away.

rht commented 3 months ago

It worked! :tada: