Skip to content

Commit 7a18e44

Browse files
authored
Fix CLI reference with code block (#12807)
Due to clap-rs/clap#5900, clap folds docstring code blocks in a way that breaks the rendering of the `uv publish --index` option to html. As a workaround, `verbatim_doc_comment` prevents this. Release: ![image](https://github.com/user-attachments/assets/66d9af51-ac23-47f6-a859-7b20a4f1f4a2) PR: ![image](https://github.com/user-attachments/assets/6a32a5a6-1dd8-49ff-a853-9df02f0141ad) Release: ``` --index <INDEX> The name of an index in the configuration to use for publishing. The index must have a `publish-url` setting, for example: ```toml [[tool.uv.index]] name = "pypi" url = "https://pypi.org/simple" publish-url = "https://upload.pypi.org/legacy/" ``` The index `url` will be used to check for existing files to skip duplicate uploads. With these settings, the following two calls are equivalent: ``` uv publish --index pypi uv publish --publish-url https://upload.pypi.org/legacy/ --check-url https://pypi.org/simple ``` [env: UV_PUBLISH_INDEX=] ``` PR: ``` --index <INDEX> The name of an index in the configuration to use for publishing. The index must have a `publish-url` setting, for example: ```toml [[tool.uv.index]] name = "pypi" url = "https://pypi.org/simple" publish-url = "https://upload.pypi.org/legacy/" ``` The index `url` will be used to check for existing files to skip duplicate uploads. With these settings, the following two calls are equivalent: ```shell uv publish --index pypi uv publish --publish-url https://upload.pypi.org/legacy/ --check-url https://pypi.org/simple ``` [env: UV_PUBLISH_INDEX=] ``` Fixes #12652
1 parent 29f57a2 commit 7a18e44

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

crates/uv-cli/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5662,12 +5662,13 @@ pub struct PublishArgs {
56625662
///
56635663
/// With these settings, the following two calls are equivalent:
56645664
///
5665-
/// ```
5665+
/// ```shell
56665666
/// uv publish --index pypi
56675667
/// uv publish --publish-url https://upload.pypi.org/legacy/ --check-url https://pypi.org/simple
56685668
/// ```
56695669
#[arg(
56705670
long,
5671+
verbatim_doc_comment,
56715672
env = EnvVars::UV_PUBLISH_INDEX,
56725673
conflicts_with = "publish_url",
56735674
conflicts_with = "check_url"

docs/reference/cli.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8821,9 +8821,17 @@ uv publish [OPTIONS] [FILES]...
88218821

88228822
<p>The index must have a <code>publish-url</code> setting, for example:</p>
88238823

8824-
<pre><code class="language-toml [[tool.uv.index]] name = &quot;pypi&quot; url = &quot;https://pypi.org/simple&quot; publish-url = &quot;https://upload.pypi.org/legacy/&quot; ```">The index `url` will be used to check for existing files to skip duplicate uploads.
8824+
<pre><code class="language-toml">[[tool.uv.index]]
8825+
name = &quot;pypi&quot;
8826+
url = &quot;https://pypi.org/simple&quot;
8827+
publish-url = &quot;https://upload.pypi.org/legacy/&quot;</code></pre>
88258828

8826-
With these settings, the following two calls are equivalent:</code></pre>
8829+
<p>The index <code>url</code> will be used to check for existing files to skip duplicate uploads.</p>
8830+
8831+
<p>With these settings, the following two calls are equivalent:</p>
8832+
8833+
<pre><code class="language-shell">uv publish --index pypi
8834+
uv publish --publish-url https://upload.pypi.org/legacy/ --check-url https://pypi.org/simple</code></pre>
88278835

88288836
<p>May also be set with the <code>UV_PUBLISH_INDEX</code> environment variable.</p>
88298837
</dd><dt id="uv-publish--keyring-provider"><a href="#uv-publish--keyring-provider"><code>--keyring-provider</code></a> <i>keyring-provider</i></dt><dd><p>Attempt to use <code>keyring</code> for authentication for remote requirements files.</p>

0 commit comments

Comments
 (0)