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

Native support for code-blocks #60

Open
azmeuk opened this issue Jun 20, 2024 · 0 comments
Open

Native support for code-blocks #60

azmeuk opened this issue Jun 20, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@azmeuk
Copy link

azmeuk commented Jun 20, 2024

Context

Sometimes I have to show large samples of code as documentation examples. As they clutter the page I tend to hide them behind a toggle button. Currently I nest code blocks in toggle containers:

    .. toggle::

        .. literalinclude :: ../samples/rfc7643-8.7.1-schema-group.json
           :language: json
           :caption: schema-group.json

Proposal

This produces a click to hide/click to show message that I found cumbersome. I would love if code-block and litteral-include blocks with a :caption: parameter could be handled in the same fashion than admonitions.

Users would click on the code sample caption, and that would show/hide the code.

What do you think?

Tasks and updates

No response

@azmeuk azmeuk added the enhancement New feature or request label Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant