about summary refs log tree commit diff
path: root/src/librustdoc/html/static
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2023-06-23 16:20:57 +0200
committerGuillaume Gomez <guillaume.gomez@huawei.com>2023-06-23 16:32:55 +0200
commit2f1939ab8b147b28809604d14876cb958e935cdd (patch)
treef0542469b17e59c346bd9eb77fc7d984a391d25d /src/librustdoc/html/static
parent2f3bed0c4c72cf4ef8019888a3bc7a9c515e6213 (diff)
downloadrust-2f1939ab8b147b28809604d14876cb958e935cdd.tar.gz
rust-2f1939ab8b147b28809604d14876cb958e935cdd.zip
Link to the corresponding channel in the help popover
Diffstat (limited to 'src/librustdoc/html/static')
-rw-r--r--src/librustdoc/html/static/js/main.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/librustdoc/html/static/js/main.js b/src/librustdoc/html/static/js/main.js
index 3a9e94e9f9f..254b0d8bf5a 100644
--- a/src/librustdoc/html/static/js/main.js
+++ b/src/librustdoc/html/static/js/main.js
@@ -1050,9 +1050,10 @@ function preLoadCss(cssUrl) {
 
     function buildHelpMenu() {
         const book_info = document.createElement("span");
+        const channel = getVar("channel");
         book_info.className = "top";
-        book_info.innerHTML = "You can find more information in \
-            <a href=\"https://doc.rust-lang.org/rustdoc/\">the rustdoc book</a>.";
+        book_info.innerHTML = `You can find more information in \
+<a href="https://doc.rust-lang.org/${channel}/rustdoc/">the rustdoc book</a>.`;
 
         const shortcuts = [
             ["?", "Show this help dialog"],
@@ -1072,9 +1073,9 @@ function preLoadCss(cssUrl) {
         div_shortcuts.innerHTML = "<h2>Keyboard Shortcuts</h2><dl>" + shortcuts + "</dl></div>";
 
         const infos = [
-            "For a full list of all search features, take a look <a \
-            href='https://doc.rust-lang.org/stable/rustdoc/how-to-read-rustdoc.html\
-            #the-search-interface'>here</a>.",
+            `For a full list of all search features, take a look <a \
+href="https://doc.rust-lang.org/${channel}/rustdoc/how-to-read-rustdoc.html\
+#the-search-interface">here</a>.`,
             "Prefix searches with a type followed by a colon (e.g., <code>fn:</code>) to \
              restrict the search to a given item kind.",
             "Accepted kinds are: <code>fn</code>, <code>mod</code>, <code>struct</code>, \