Skip to content

Code blocks do not render 88 chars without horizontal scrollbar #12945

Closed

Description

@cbrnr

We're using a line length of 88 characters in our code base, and that's also the standard in the Python community nowadays (e.g., enforced by Ruff and Black). Therefore, I think it would be great if code blocks on our documentation website could be rendered without horizontal scrollbars. For example, see the very last code block at the bottom of https://mne.tools/stable/auto_tutorials/epochs/40_autogenerate_metadata.html.

Activity

  1. hoechenberger commented on Nov 5, 2024

    @hoechenberger
    Member

    I don't understand the intention here, how would I scroll if you remove the scrollbar? I have to scroll on my screen to uncover all of the code

  2. hoechenberger commented on Nov 5, 2024

    @hoechenberger
    Member

    Or are you suggesting enforcing shorter lines for code blocks?

  3. drammock commented on Nov 5, 2024

    @drammock
    Member

    I thought the intent was "make the content area wider and/or shrink the font so that 88 chars is visible without scrolling". @cbrnr can you confirm/clarify?

  4. cbrnr commented on Nov 5, 2024

    @cbrnr
    ContributorAuthor

    Yes, exactly what you're saying @drammock!

  5. hoechenberger commented on Nov 5, 2024

    @hoechenberger
    Member

    yeah but ... on my screen, you cannot make it any wider without hiding the navigation

    slightly reducing the font size should be fine, but I'm not sure if this will free up enough space

  6. cbrnr commented on Nov 7, 2024

    @cbrnr
    ContributorAuthor

    I mean, since we are using 88 characters in our codebase, I think our website should also support displaying 88 characters without scrolling. I'm not a fan of shrinking the font size since this will make the code harder to read, and I would prefer making our main area wider. Forcing a shorter line length for our documentation is also not a good option since we want to stay consistent with our source code.

  7. cbrnr commented on Nov 7, 2024

    @cbrnr
    ContributorAuthor

    Maybe we can make one or both navigation panes a bit narrower so that the main area works with 88 chars in code blocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions