Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add expand button for some block elements #149

Open
autoreconf opened this issue Jun 21, 2023 · 2 comments
Open

Add expand button for some block elements #149

autoreconf opened this issue Jun 21, 2023 · 2 comments

Comments

@autoreconf
Copy link

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
Copy link
Owner

mgeier commented Jun 24, 2023

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
Copy link
Author

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

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

No branches or pull requests

2 participants