mgeier / insipid-sphinx-theme

:yawning_face: An insipid theme for the Sphinx documentation generator.
https://insipid-sphinx-theme.readthedocs.io/
BSD 2-Clause "Simplified" License
38 stars 4 forks source link

Add expand button for some block elements #149

Open autoreconf opened 1 year ago

autoreconf commented 1 year ago

When some block elements contains longer displays of verbatim text, it's better only render block elements a small height. Using expand button to get full height. Examples: code block table Javascript files in those html: js for code block js for table

:)

mgeier commented 1 year ago

Are you sure this is something a theme should do? Wouldn't this be more appropriate for a Sphinx extension?

This way, it could probably also allow switching this behavior on and off via reST syntax.

Since your examples also show a copy button, this is maybe something that could be combined with https://github.com/executablebooks/sphinx-copybutton/?

This also reminds me a bit of https://github.com/executablebooks/sphinx-design, but AFAICT, they don't provide anything for code blocks.

Examples: ... table

I see a button there but it doesn't seem to do anything?

autoreconf commented 1 year ago

I see a button there but it doesn't seem to do anything?

Button is working, may be your browser not support it. Could you please try another browser if you want, both mobile and desktop.

Are you sure this is something a theme should do? Wouldn't this be more appropriate for a Sphinx extension?

May be you are right, I already integrated sphinx-copybutton extension into all my docs. And also open an issue in that project. executablebooks/sphinx-copybutton#208

This way, it could probably also allow switching this behavior on and off via reST syntax.

I'm using MyST(markdown). You may be interested in this article https://hexatomic.github.io/documentation/tooling/evaluation.html