mirror of
https://github.com/astral-sh/uv.git
synced 2025-09-26 03:59:13 +00:00
Replace uv help python
references in CLI documentation with links (#5871)
Following #5869, the documentation has some less-than-helpful suggestions to use `uv help python` for details — we should link to the `uv python` section instead.
This commit is contained in:
parent
fe2849af6a
commit
c95bf76dfe
2 changed files with 35 additions and 22 deletions
|
@ -13,6 +13,15 @@ use crate::ROOT_DIR;
|
|||
|
||||
use uv_cli::Cli;
|
||||
|
||||
const REPLACEMENTS: &[(&str, &str)] = &[
|
||||
// Replace suggestions to use `uv help python` with a link to the
|
||||
// `uv python` section
|
||||
(
|
||||
"<code>uv help python</code>",
|
||||
"<a href=\"#uv-python\">uv python</a>",
|
||||
),
|
||||
];
|
||||
|
||||
#[derive(clap::Args)]
|
||||
pub(crate) struct Args {
|
||||
/// Write the generated output to stdout (rather than to `settings.md`).
|
||||
|
@ -84,6 +93,10 @@ fn generate() -> String {
|
|||
output.push_str("# CLI Reference\n\n");
|
||||
generate_command(&mut output, &uv, &mut parents);
|
||||
|
||||
for (value, replacement) in REPLACEMENTS {
|
||||
output = output.replace(value, replacement);
|
||||
}
|
||||
|
||||
output
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue