Skip to content

host javascript libraries and let crates optionally load them in #302

Open

Description

There is a prominent group of crates that have used a trick to load in the KaTeX library to render equations in their docs. Previously, these crates have been able to point their doc process at a cached file when building that would load in an HTML file that sources the library. However, when we migrated the server last year, the cached file was lost, and new attempts to load a new cached file have failed to properly locate it.

Instead of tweaking folder permissions to allow the doc process to point at this hard-coded file, why don't we start hosting this library? We could add a new option to our metadata that people could use to specify a library (from a list of ones we've approved to start hosting), and then we would add the --html-in-header flag to the rustdoc call to splice in the required loads. (I would also like to start hosting the JS files themselves, so that would need to be tracked as well.) This way, the crates that need a specific library can use it, and we don't have to try to support the hard-coded paths that they've been using in the past. We could even add more stuff, like highlight-js or Highcharts or something else.

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

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