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

rustdoc: Consolidate static-file replacement mechanism #91062

Merged
merged 3 commits into from
Nov 27, 2021

Commits on Nov 25, 2021

  1. Simplify rendering of stylesheet links into HTML

    We carry around a list of stylesheets that can carry two different types
    of thing:
    
     1. Internal stylesheets specific to a page type (only for settings)
     2. Themes
    
    In this change I move the link generation for settings.css into
    settings(), so Context.style_files is reserved just for themes.
    
    We had two places where we extracted a base theme name from a list of
    StylePaths. I consolidated that code to be a method on StylePath.
    
    I moved generation of link tags for stylesheets into the page.html
    template. With that change, I made the template responsible for special
    handling of light.css (making it the default theme) and of the other
    themes (marking them disabled). That allowed getting rid of the
    `disabled` field on StylePath.
    jsha committed Nov 25, 2021
    Configuration menu
    Copy the full SHA
    3649b90 View commit details
    Browse the repository at this point in the history
  2. Move themes and version into rustdoc-vars

    We had been injecting the list of themes and the rustdoc version into
    main.js by rewriting it at doc generation time. By avoiding this
    rewrite, we can make it easier to edit main.js without regenerating all
    the docs.
    
    Added a more convenient accessor for rustdoc-vars.
    
    Changed storage.js to not rely on resourcesSuffix. It could in theory
    use rustdoc-vars, but because rustdoc-vars is at the end of the HTML,
    it's not available when storage.js runs (very early in page load).
    jsha committed Nov 25, 2021
    Configuration menu
    Copy the full SHA
    f0683f9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d9afca5 View commit details
    Browse the repository at this point in the history