Skip to content

Add workaround for sphinx-togglebutton rtd-theme compat problem - #111

Open
frankier wants to merge 1 commit into
coderefinery:masterfrom
frankier:click-to-show-alignment
Open

frankier wants to merge 1 commit into
coderefinery:masterfrom
frankier:click-to-show-alignment

Conversation

@frankier

@frankier frankier commented Mar 6, 2026

Copy link
Copy Markdown

@frankier
frankier marked this pull request as draft March 6, 2026 13:44
@frankier
frankier marked this pull request as ready for review March 6, 2026 13:49
@rkdarst

rkdarst commented Mar 9, 2026

Copy link
Copy Markdown
Member

Nice! That has bothered me for quite a while but I never looked enough to do something about it.

Some notes:

  • Can you think of a way to condition this to only apply when the them is sphinx-rtd-theme? In theory we say that sphinx-lesson works in different themes so we shouldn't try to do anything theme-specific here.
  • It could go here, which is just for sphinx-rtd-theme (style fixups we use for basically all our sites, so may as well go here): https://github.com/AaltoSciComp/sphinx_rtd_theme_ext_color_contrast/ I can copy it there myself if you think it's good.

Aside, I saw that Sphinx includes something upstream now: https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-seealso (this isn't the anchor but look at "collapseable text" right below here). I wonder if sometime it would be better to move to this instead of a separate extension.

@rkdarst

rkdarst commented Mar 9, 2026

Copy link
Copy Markdown
Member

I put it here:
AaltoSciComp/sphinx_rtd_theme_ext_color_contrast#9
Do you know that this works (do I need to test myself?)

@eglerean

Copy link
Copy Markdown
Member

this could be merged ...
/signed someone annoyed by css :D

rkdarst added a commit to AaltoSciComp/sphinx_rtd_theme_ext_color_contrast that referenced this pull request Sep 28, 2026
- Maybe doesn't go here but does is a sphinx-rtd-theme specific issue
  so most natuarlly goes in this repo, to get inherited to where it's
  needed.
- Original fix from coderefinery/sphinx-lesson#111
  with all code by @frankier
@rkdarst

rkdarst commented Sep 28, 2026

Copy link
Copy Markdown
Member

I see uncommitted code in my sphinx-rtd-theme-ext-color-contrast repo so I will deploy that

rkdarst added a commit to AaltoSciComp/sphinx_rtd_theme_ext_color_contrast that referenced this pull request Sep 28, 2026
- Maybe doesn't go here but does is a sphinx-rtd-theme specific issue
  so most natuarlly goes in this repo, to get inherited to where it's
  needed.
- Original fix from coderefinery/sphinx-lesson#111
  with all code by @frankier
@rkdarst

rkdarst commented Sep 28, 2026

Copy link
Copy Markdown
Member

I have now deployed this in https://pypi.org/project/sphinx-rtd-theme-ext-color-contrast/ version 0.3.3.

My fresh rebuild of social-coding with newly rebuilt environment implies it works as expected.

@rkdarst

rkdarst commented Sep 28, 2026

Copy link
Copy Markdown
Member

I'm sorry for making a new PR/fix but I credited @frankier. Now lessons need to rebuild to get it. I'll leave this open until the fix is verified.

@rkdarst

rkdarst commented Sep 28, 2026

Copy link
Copy Markdown
Member

Um, why does it appear to be expanded by default now... investigating

@rkdarst

rkdarst commented Sep 28, 2026

Copy link
Copy Markdown
Member

False-ish alarm: it works OK on the normal lesson pages, but in the exercise list it is expanded by default. But, it was already broken like this sometimes in the exercise list, so maybe that's OK for now... it needs to be figured out, though.

@frankier

Copy link
Copy Markdown
Author

Thanks Richard for improving the fix and sorry for not responding earlier -- slipped my mind.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants