Skip to content

Commit 79df3c9

Browse files
authored
docs: fix some doc warnings and xrefs (bazel-contrib#2176)
This fixes a few warnings Sphinx emits when processing docs * Fix py_console_script_binary reference in changelog * Remove `*` that doesn't match anything in index * Replace heading with rubric to remove warning about non-consecutive indent * Remove duplicate bzl:type role definition
1 parent 50f6ce7 commit 79df3c9

File tree

5 files changed

+15
-21
lines changed

5 files changed

+15
-21
lines changed

CHANGELOG.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -767,8 +767,7 @@ Breaking changes:
767767

768768
### Added
769769

770-
* (bzlmod, entry_point) Added
771-
[`py_console_script_binary`](./docs/py_console_script_binary.md), which
770+
* (bzlmod, entry_point) Added {obj}`py_console_script_binary`, which
772771
allows adding custom dependencies to a package's entry points and customizing
773772
the `py_binary` rule used to build it.
774773

docs/api/index.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,5 @@
22

33
```{toctree}
44
:glob:
5-
*
65
*/index
76
```

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
autodoc2_docstring_parser_regexes = [
6060
(".*", "myst"),
6161
]
62-
62+
6363
# NOTE: The redirects generation will clobber existing files.
6464
redirects = {
6565
"api/tools/precompiler/index": "/api/rules_python/tools/precompiler/index.html",

python/private/pypi/pip_repository.bzl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,9 @@ alias(
326326
)
327327
```
328328
329-
### Vendoring the requirements.bzl file
329+
:::{rubric} Vendoring the requirements.bzl file
330+
:heading-level: 3
331+
:::
330332
331333
In some cases you may not want to generate the requirements.bzl file as a repository rule
332334
while Bazel is fetching dependencies. For example, if you produce a reusable Bazel module

sphinxdocs/docs/sphinx-bzl.md

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,16 @@ Refer to a target.
140140

141141
:::{rst:role} bzl:type
142142
Refer to a type or type expression; can also be used in argument documentation.
143+
144+
```
145+
def func(arg):
146+
"""Do stuff
147+
148+
Args:
149+
arg: {type}`int | str` the arg
150+
"""
151+
print(arg + 1)
152+
```
143153
:::
144154

145155
## Special roles
@@ -187,22 +197,6 @@ def func():
187197
```
188198
:::
189199

190-
:::{rst:role} bzl:type
191-
192-
Indicates the type of an argument for a function. Use it in the Args doc of
193-
a function.
194-
195-
```
196-
def func(arg):
197-
"""Do stuff
198-
199-
Args:
200-
arg: {type}`int`
201-
"""
202-
print(arg + 1)
203-
```
204-
:::
205-
206200
## Directives
207201

208202
Most directives are automatically generated by `sphinx_stardoc`. Here, we only

0 commit comments

Comments
 (0)