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:
Zanie Blue 2024-08-07 12:21:09 -05:00 committed by GitHub
parent fe2849af6a
commit c95bf76dfe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 35 additions and 22 deletions

View file

@ -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
}