Skip to content

Source browser only shows 95 characters #296

Closed
@iliekturtles

Description

@iliekturtles

Clicking the Source link (e.g. https://docs.rs/crate/uom/0.21.0/source/src/storage_types.rs, line 7) in the docs.rs header goes to a page where the source view only shows 95 characters. The default rustfmt maximum line width is 100 which means horizontal scrolling is sometimes necessary. Note that clicking a src link (e.g. https://docs.rs/uom/0.21.0/src/uom/storage_types.rs.html#7) within the documentation goes to a different view with a collapsed sidebar that shows over 100 characters.

After some experimentation I found that in Firefox/Chrome/Edge changing the font-size from the default of 16px inherited from body to 15px allows for 101 characters to be seen. There didn't seem to be a great spot in the scss file to make the change so I have not submitted a PR, but am willing to do so with a bit of guidance:

  • Is this a desired change?
  • Would using an rem or em font be preferred? I only used 15px in my experimentation because body's font-size was also specified in px.
  • Should both source views be updated so that the font-size is consistent?
    • Would this require a rustdoc change?
  • Where should the change be applied?
    • For all pre elements?
    • .package-page-container pre, .example-wrap pre?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions