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

feature: Setting to have codeblocks un-collapsed as default #259

Open
Wesztman opened this issue Mar 3, 2025 · 2 comments
Open

feature: Setting to have codeblocks un-collapsed as default #259

Wesztman opened this issue Mar 3, 2025 · 2 comments
Assignees
Labels
feature New feature or request

Comments

@Wesztman
Copy link

Wesztman commented Mar 3, 2025

Is your feature request related to a problem? Please describe.

When doing documentation where the code is a big focus and you have many examples for the user it would be nice to have a setting to get the code blocks un-collapsed/open as default 😊

Describe the solution you'd like

A setting would be nice, something like collapse_codeblocks_as_default with default true, but which can be overwritten with false to get all code blocks to stay open.

Maybe implemented like so <details class="quote" {% if not config.collapse_codeblocks_as_default %} open {% endif %}> in class.html.jinja and function.html.jinja.

Describe alternatives you've considered

What I've done now is that I've used custom templates for class.html.jinja and function.html.jinja with assistance from @pawamoy 😊

Additional context

Discussion regarding this can be found here.

@Wesztman Wesztman added the feature New feature or request label Mar 3, 2025
@pawamoy
Copy link
Member

pawamoy commented Mar 3, 2025

Thanks for the feature request @Wesztman 🙂 Sounds good. I'd add an expand_source option which defaults to False. PRs welcome! Otherwise I'll get to it eventually 🙂

@Wesztman
Copy link
Author

Wesztman commented Mar 3, 2025

Sounds awsome, I'll try my hands on a PR 😊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants