Add remind appendix to book search

This commit is contained in:
Folyd 2022-10-28 00:33:41 +08:00
parent 627789b7d1
commit 94d83d4313
2 changed files with 8 additions and 2 deletions

View file

@ -14,7 +14,7 @@ class HelpCommand extends Command {
"~": `Prefix ${c.match("~")} to search external crate's docs`,
"@": `Prefix ${c.match("@crate")} (${c.dim("e.g. @tokio")}) to search that crate's doc exclusively`,
"#": `Prefix ${c.match("#")} to search builtin attributes`,
"%": `Prefix ${c.match("%")} to search Rust official book chapters`,
"%": `Prefix ${c.match("%")} to search Rust book chapters`,
">": `Prefix ${c.match(">")} to search Rust clippy lints`,
"?": `Prefix ${c.match("?")} to search caniuse.rs`,
"1.": `Input ${c.match("Rust version")} (${c.dim("e.g. 1.42.0")}) to open its release page`,

View file

@ -377,7 +377,13 @@ function getPlatformOs() {
content: page.url,
description: `${[...parentTitles.map(t => c.escape(t)), c.match(c.escape(page.title))].join(" > ")} - ${c.dim(page.name)}`
}
}
},
onAppend: () => {
return [{
content: ":book",
description: `Remind: ${c.dim("you can use")} :book ${c.dim("command to search all Rust books.")}`,
}];
},
});
const LINT_URL = "https://rust-lang.github.io/rust-clippy/master/";