diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2021-09-17 17:41:19 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-09-17 17:41:19 +0200 |
| commit | 833358b96444cd63e211f1fc1e47fc87ffe5be28 (patch) | |
| tree | 8765327e84e000f6eb3f31f5aa0e96279fa9b1e0 /src/librustdoc/html/render/write_shared.rs | |
| parent | eb62779f2d6dc5cfe9208416e13392744b4e76ac (diff) | |
| parent | cd3f4da244578a2ab4d17d10016c61b9191b21e4 (diff) | |
| download | rust-833358b96444cd63e211f1fc1e47fc87ffe5be28.tar.gz rust-833358b96444cd63e211f1fc1e47fc87ffe5be28.zip | |
Rollup merge of #88964 - GuillaumeGomez:version-help, r=Nemo157
Add rustdoc version into the help popup After a discussion with a rustdoc user about a specific behaviour, we realized we were not talking about the same version. To add on top of it, it was actually not that simple to find out the version since it was hosted documentation. So to simplify things, I added the version into the help popup:  Does the version format looks or would you prefer that I add more information? We can also add the commit hash, commit date, host and release. cc `@rust-lang/rustdoc` r? `@jyn514`
Diffstat (limited to 'src/librustdoc/html/render/write_shared.rs')
| -rw-r--r-- | src/librustdoc/html/render/write_shared.rs | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/librustdoc/html/render/write_shared.rs b/src/librustdoc/html/render/write_shared.rs index 1dd0917699b..c1a83ad5820 100644 --- a/src/librustdoc/html/render/write_shared.rs +++ b/src/librustdoc/html/render/write_shared.rs @@ -268,10 +268,18 @@ pub(super) fn write_shared( // Maybe we can change the representation to move this out of main.js? write_minify( "main.js", - static_files::MAIN_JS.replace( - "/* INSERT THEMES HERE */", - &format!(" = {}", serde_json::to_string(&themes).unwrap()), - ), + static_files::MAIN_JS + .replace( + "/* INSERT THEMES HERE */", + &format!(" = {}", serde_json::to_string(&themes).unwrap()), + ) + .replace( + "/* INSERT RUSTDOC_VERSION HERE */", + &format!( + "rustdoc {}", + rustc_interface::util::version_str().unwrap_or("unknown version") + ), + ), cx, options, )?; |
