| Age | Commit message (Collapse) | Author | Lines |
|
|
|
This flag isn't needed anymore. See #83784.
|
|
Avoid CJK legacy fonts in Windows
As metioned in #84035, the default serif CJK font in Windows is meh-looking.
To avoid this, we should use sans-serif font or provide CJK glyph supported font in `rustdoc.css`.
|
|
rustdoc: Call `initSidebarItems` in root module of crate
r? `@jsha`
Resolves #85301
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rustdoc: move some search code into search.js
This reduces main.s from 3094 lines to 1587. Also it saves some bytes
of download in the case where search isn't used.
There were a fair number of variables that needed to be accessible in
both main.js and search.js, but I didn't want to put too many symbols in
the global namespace, so I consolidated much of the search-related
state and functions into a new object `window.searchState`.
Demo at https://hoffman-andrews.com/rust/move-search/std/?search=foo
|
|
Instead of using a depth counter and adding "../" to get to the top,
this commit makes rustdoc actually compare the path of what it's
linking from to the path that it's linking to. This makes the resulting
HTML shorter.
Here's a comparison of one of the largest (non-source) files in the
Rust standard library docs (about 4% improvement before gzipping).
$ wc -c struct.Wrapping.old.html struct.Wrapping.new.html
2387389 struct.Wrapping.old.html
2298538 struct.Wrapping.new.html
Most if it can be efficiently gzipped away.
$ wc -c struct.Wrapping.old.html.gz struct.Wrapping.new.html.gz
70679 struct.Wrapping.old.html.gz
70050 struct.Wrapping.new.html.gz
But it also makes a difference in the final DOM size, reducing it from 91MiB to 82MiB.
|
|
|
|
Export a few variables and functions into the global scope because they
are needed both by main.js and search-index.js.
|
|
Now the family name is Source Serif 4 (upstream issue 77) instead of
Source Serif Pro.
|
|
rustdoc: Add unstable option to only emit shared/crate-specific files
The intended use case is for docs.rs, which can now copy exactly the
files it cares about, rather than having to guess based on whether they
have a resource suffix or not. In particular, some files have a resource
suffix but cannot be shared between crates: https://github.com/rust-lang/docs.rs/pull/1312#issuecomment-798783688
The end goal is to fix rust-lang/docs.rs#1327 by reverting rust-lang/docs.rs#1324.
This obsoletes `--print=unversioned-files`, which I plan to remove as
soon as docs.rs stops using it.
I recommend reviewing this one commit at a time.
r? ``@GuillaumeGomez`` cc ``@Nemo157`` ``@pietroalbini``
|
|
invocation specific
|
|
|
|
This also changes custom themes from Toolchain to Crate files.
|
|
The intended use case is for docs.rs, which can now copy exactly the
files it cares about, rather than having to guess based on whether they
have a resource suffix or not. In particular, some files have a resource
suffix but cannot be shared between crates: https://github.com/rust-lang/docs.rs/pull/1312#issuecomment-798783688
The end goal is to fix https://github.com/rust-lang/docs.rs/issues/1327
by reverting https://github.com/rust-lang/docs.rs/pull/1324.
This obsoletes `--print=unversioned-files`, which I plan to remove as
soon as docs.rs stops using it.
|
|
This cleans up the code quite a bit, and also makes the next commit much
easier.
|
|
|
|
Remove theme.js file
Fixes #82616.
The first commit moves the `theme.js` file into `main.js`, which requires to also run a small `.replace` on the `main.js` content.
The second commit is just a small cleanup to centralize DOM ids.
Since it removes a file from rustdoc output: cc `@rust-lang/docs-rs`
cc `@jsha`
r? `@jyn514`
|
|
|
|
This allows sharing those files between different doc invocations
without having to know their names ahead of time.
|
|
This allows querying it programatically.
|
|
|
|
|