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

Improve the documentation website rendering such that code blocks are wider on wider screens #1280

Open
1 task done
RaghuSpaceRajan opened this issue Dec 20, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@RaghuSpaceRajan
Copy link
Contributor

RaghuSpaceRajan commented Dec 20, 2024

Proposal

When going through the documentation website and going to the source code from there, the code blocks that appear on the next page have a scrollbar at the bottom if the code is too long to fit inside the code block. While this may be okay on narrower screens, on wider screens still having a narrow code block leads to a poorer experience, because we need to constantly go to the bottom of the page to adjust the scrollbar of the code block. Please see the attached screenshot of this doc page with the scrollbar highlighted on Google Chrome. My proposal is to set the width of these code blocks adaptively based on the window width of the browser.

gymnasium_docs_screenshot_20241220_203623

Motivation

No response

Pitch

No response

Alternatives

No response

Additional context

No response

Checklist

  • I have checked that there is no similar issue in the repo
@RaghuSpaceRajan RaghuSpaceRajan added the enhancement New feature or request label Dec 20, 2024
@pseudo-rnd-thoughts
Copy link
Member

Thanks for the suggestion @RaghuSpaceRajan

@mgoulao Do you have any ideas? Looking online (chatgpt) we could specify a custom css file in conf.py that contains custom code-block css,

.highlight pre {
    max-width: 80%; /* Or set a fixed width like 800px */
    margin: auto;   /* Center the code block */
    overflow: auto; /* Add scrollbars if content overflows */
}

Do you think this could work?

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

2 participants