readthedocs / sphinx_rtd_theme

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

Move JS alter of HTML into Sphinx writer #783

Open agjohnson opened 5 years ago

agjohnson commented 5 years ago

We are currently altering the output slightly using JS after the build:

https://github.com/readthedocs/sphinx_rtd_theme/blob/bad21120c8d12b4dd15c6b5383dd3fe5909def56/js/theme.js#L101-L110

This is a procedure that could be handled using a custom Sphinx writer instead. If we want to switch the theme to always using the HTML5 writer, regardless of Sphinx version, we can extend this writer to output structures we're expecting in the JS, instead of hacking it into the output afterwards.

I don't have public code to show the POC, but noting this issue for later.

humitos commented 1 month ago

If we want to switch the theme to always using the HTML5 writer

HTML5 writer is the only writer we support now 👍🏼