Skip to content

Commit 7441777

Browse files
committed
docs(style): align docs references
why: docs guidance requires useful first-mention links and one-command console examples so readers can navigate reference docs without parsing inline shell prose. what: - Link CLI option, API, and external project references - Split contributor and release shell examples into console blocks - Keep changelog headings linkable without unlinked first mentions
1 parent c534812 commit 7441777

7 files changed

Lines changed: 114 additions & 34 deletions

File tree

CHANGES

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,17 @@ g 0.0.10 turns g's documentation into a usable CLI reference and moves the docs
4242

4343
### What's new
4444

45-
#### `g --version` / `g -V` report g's version (#46)
45+
#### {argparse:option}`g --version` / {argparse:option}`g -V` report g's version (#46)
4646

47-
`g --version` and `g -V` now print g's installed version instead of forwarding those flags to `git`, `svn`, or `hg`. This gives users a direct way to confirm which wrapper version is on `PATH` while keeping the normal proxy behavior unchanged for VCS commands.
47+
{argparse:option}`g --version` and {argparse:option}`g -V` now print g's installed version instead of forwarding those flags to `git`, `svn`, or `hg`. This gives users a direct way to confirm which wrapper version is on `PATH` while keeping the normal proxy behavior unchanged for VCS commands.
4848

4949
The implementation preserves the existing {func}`g.run` test hook: in test mode the version path returns cleanly instead of exiting through {mod}`argparse`, so the behavior can be asserted without special subprocess handling.
5050

5151
#### First-party CLI reference page (#46)
5252

53-
The new {doc}`cli/index` page explains g's repository detection flow, shows command equivalence examples, and renders {func}`g.create_parser` through the argparse documentation extension. Argument sections now have stable anchors, so users can link directly to the version flags or pass-through argument reference.
53+
The new {doc}`cli/index` page explains g's repository detection flow, shows command equivalence examples, and renders {func}`g.create_parser` through the argparse documentation extension. Argument sections now have stable anchors, so users can link directly to the {argparse:option}`version flags <g --version>` or {argparse:positional}`pass-through argument reference <g vcs_args>`.
5454

55-
The CLI docs also clarify the one exception to g's pass-through model: `--version` and `-V` are handled by g itself, while the remaining arguments are sent to the detected VCS command.
55+
The CLI docs also clarify the one exception to g's pass-through model: {argparse:option}`--version <g --version>` and {argparse:option}`-V <g -V>` are handled by g itself, while the remaining arguments are sent to the detected VCS command.
5656

5757
#### Documentation frontend refresh (#50, #51)
5858

@@ -80,7 +80,7 @@ of lines of local documentation plumbing.
8080
### Fixes
8181

8282
- The CLI documentation cards now use reference links instead of URL-fragment options, avoiding MyST directive parsing warnings in grid cards (#54).
83-
- The manual CLI "Usage" section was renamed to "Usage examples" so it no longer collides with the argparse-generated `usage` anchor (#54).
83+
- The manual CLI "Usage" section was renamed to "Usage examples" so it no longer collides with the argparse-generated {ref}`usage` anchor (#54).
8484
- Light and dark mode CSS for argparse metadata and header links now handles Furo's automatic theme mode correctly (#46).
8585

8686
### Documentation
@@ -100,13 +100,13 @@ matching reference material.
100100

101101
## g 0.0.9 (2026-01-24)
102102

103-
g 0.0.9 hardens release and documentation publishing. The project no longer relies on long-lived PyPI or AWS secrets for the main publishing paths, and the release job now participates in PyPI's trusted-publishing and attestation flow.
103+
g 0.0.9 hardens release and documentation publishing. The project no longer relies on long-lived [PyPI](https://pypi.org/) or [AWS](https://aws.amazon.com/) secrets for the main publishing paths, and the release job now participates in PyPI's trusted-publishing and attestation flow.
104104

105105
### What's new
106106

107-
#### PyPI Trusted Publisher release flow (#43)
107+
#### Trusted Publisher release flow (#43)
108108

109-
Package publishing moved from stored API credentials to PyPI Trusted Publisher via [GitHub Actions](https://docs.github.com/actions) OIDC. The release workflow requests `id-token` and attestation permissions, publishes without embedding a PyPI token in repository secrets, and fixes the deprecated `skip_existing` input name along the way.
109+
Package publishing moved from stored API credentials to [PyPI Trusted Publisher](https://docs.pypi.org/trusted-publishers/) via [GitHub Actions](https://docs.github.com/actions) [OIDC](https://openid.net/developers/how-connect-works/). The release workflow requests `id-token` and attestation permissions, publishes without embedding a PyPI token in repository secrets, and fixes the deprecated `skip_existing` input name along the way.
110110

111111
#### OIDC-backed documentation deployment
112112

@@ -119,7 +119,7 @@ Documentation deployment moved to AWS OIDC authentication and the [AWS CLI](http
119119

120120
## g 0.0.8 (2025-11-01)
121121

122-
g 0.0.8 updates the supported Python window for current runtimes. Python 3.9 support is removed after end of life, and Python 3.14 is added to the classifiers, test matrix, and docs build path.
122+
g 0.0.8 updates the supported [Python](https://www.python.org/) window for current runtimes. Python 3.9 support is removed after end of life, and Python 3.14 is added to the classifiers, test matrix, and docs build path.
123123

124124
### Breaking changes
125125

@@ -213,15 +213,15 @@ g 0.0.3 tightens the development harness around the small CLI wrapper. The relea
213213

214214
### Documentation
215215

216-
#### Docstrings and pydocstyle enforcement (#18)
216+
#### Docstring style enforcement (#18)
217217

218-
Ruff now enforces pydocstyle with the NumPy convention, and the public modules, functions, tests, and docs configuration were updated with compliant docstrings. This makes the API documentation and doctest surface less dependent on undocumented behavior.
218+
Ruff now enforces [pydocstyle](https://www.pydocstyle.org/) with the [NumPy](https://numpydoc.readthedocs.io/en/latest/format.html) convention, and the public modules, functions, tests, and docs configuration were updated with compliant docstrings. This makes the API documentation and doctest surface less dependent on undocumented behavior.
219219

220220
### Development
221221

222-
#### Pytest and Poetry configuration cleanup (#14)
222+
#### Test and packaging configuration cleanup (#14)
223223

224-
Pytest configuration moved into `pyproject.toml`, and Poetry development dependencies moved from extras into proper dependency groups. That layout matches Poetry's current model and keeps test configuration next to the rest of the project metadata.
224+
[Pytest](https://docs.pytest.org/) configuration moved into `pyproject.toml`, and Poetry development dependencies moved from extras into proper dependency groups. That layout matches Poetry's current model and keeps test configuration next to the rest of the project metadata.
225225

226226
#### Ruff replaces the older formatting and lint stack (#11, #17)
227227

@@ -251,7 +251,7 @@ The import package moved under `src/g`, with CI and docs paths updated to match.
251251

252252
#### Early lint rule coverage (#4, #5)
253253

254-
The development stack added flake8-bugbear and flake8-comprehensions, giving the small codebase better checks for common Python mistakes and simplification opportunities.
254+
The development stack added [flake8-bugbear](https://github.com/PyCQA/flake8-bugbear) and [flake8-comprehensions](https://github.com/adamchainz/flake8-comprehensions), giving the small codebase better checks for common Python mistakes and simplification opportunities.
255255

256256
## g 0.0.1 (2022-08-17)
257257

@@ -281,7 +281,7 @@ The first docs site used Sphinx, the Furo theme, and `sphinx-autobuild` for loca
281281

282282
### Development
283283

284-
Initial CI, Codecov, S3, and [CloudFront](https://aws.amazon.com/cloudfront/) deployment plumbing landed with the package scaffold.
284+
Initial CI, [Codecov](https://about.codecov.io/), [S3](https://aws.amazon.com/s3/), and [CloudFront](https://aws.amazon.com/cloudfront/) deployment plumbing landed with the package scaffold.
285285

286286
<!---
287287
.. vim: set filetype=markdown:

docs/api.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ Most users do not need this page. Start with {doc}`quickstart` or
44
{doc}`cli/index` if you only want the command-line wrapper.
55

66
```{note}
7-
These APIs are private and can break between versions. If you want to use them directly, file an issue on the tracker.
7+
These APIs are private and can break between versions. If you want to use them
8+
directly, file an issue on the [tracker].
89
```
910

1011
```{eval-rst}
@@ -13,3 +14,5 @@ These APIs are private and can break between versions. If you want to use them d
1314
:show-inheritance:
1415
:undoc-members:
1516
```
17+
18+
[tracker]: https://github.com/vcs-python/g/issues

docs/cli/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ When you run `g`, it:
3030
2. Invokes the corresponding VCS (`git`, `svn`, or `hg`) with your arguments
3131
3. Exits after the command completes
3232

33-
**Note:** `--version`/`-V` is handled by g itself rather than passed to the VCS.
33+
**Note:** {argparse:option}`--version <g --version>`/{argparse:option}`-V <g -V>`
34+
is handled by g itself rather than passed to the VCS.
3435

3536
## Usage examples
3637

docs/index.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,23 @@ See {doc}`quickstart` for all installation methods and first steps.
4646
$ g status
4747
```
4848

49-
Inside a git repo this runs `git status`; inside an svn checkout it runs `svn status`; inside a mercurial repo it runs `hg status`.
49+
Inside a git repo, that is equivalent to:
50+
51+
```console
52+
$ git status
53+
```
54+
55+
Inside an svn checkout:
56+
57+
```console
58+
$ svn status
59+
```
60+
61+
Inside a mercurial repo:
62+
63+
```console
64+
$ hg status
65+
```
5066

5167
[Git]: https://git-scm.com/
5268
[Mercurial]: https://www.mercurial-scm.org/

docs/project/contributing.md

Lines changed: 60 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,17 @@ $ make test
4040

4141
## Automatically run tests on file save
4242

43-
1. `make start` (via [pytest-watcher])
44-
2. `make watch_test` (requires installing [entr(1)])
43+
Run tests once, then keep watching with [pytest-watcher]:
44+
45+
```console
46+
$ make start
47+
```
48+
49+
Watch through [entr(1)] if you have it installed:
50+
51+
```console
52+
$ make watch_test
53+
```
4554

4655
[pytest-watcher]: https://github.com/olzhasar/pytest-watcher
4756

@@ -52,22 +61,62 @@ Default preview server: http://localhost:8034
5261
[sphinx-autobuild] builds the docs, watches for file changes, and launches a
5362
server.
5463

55-
From home directory: `make start_docs`
56-
From inside `docs/`: `make start`
64+
From the project root:
65+
66+
```console
67+
$ make start_docs
68+
```
69+
70+
From inside `docs/`:
71+
72+
```console
73+
$ make start
74+
```
5775

5876
[sphinx-autobuild]: https://github.com/executablebooks/sphinx-autobuild
5977

6078
### Manual documentation
6179

62-
`cd docs/` and `make html` to build. `make serve` to start http server.
80+
Enter the docs directory:
6381

64-
Helpers:
65-
`make build_docs`, `make serve_docs`
82+
```console
83+
$ cd docs
84+
```
85+
86+
Build the docs:
6687

67-
Rebuild docs on file change: `make watch_docs` (requires [entr(1)])
88+
```console
89+
$ make html
90+
```
6891

69-
Rebuild docs and run server via one terminal: `make dev_docs` (requires above, and a
70-
`make(1)` with `-J` support, e.g. GNU Make)
92+
Start the HTTP server:
93+
94+
```console
95+
$ make serve
96+
```
97+
98+
Project-root helpers run the same docs tasks:
99+
100+
```console
101+
$ make build_docs
102+
```
103+
104+
```console
105+
$ make serve_docs
106+
```
107+
108+
Rebuild docs on file change with [entr(1)]:
109+
110+
```console
111+
$ make watch_docs
112+
```
113+
114+
Rebuild docs and run the server through one terminal when your [GNU Make] has
115+
`-J` support:
116+
117+
```console
118+
$ make dev_docs
119+
```
71120

72121
## Formatting / Linting
73122

@@ -200,6 +249,7 @@ See {doc}`/project/releasing` before preparing a release.
200249
[uv]: https://github.com/astral-sh/uv
201250
[entr(1)]: http://eradman.com/entrproject/
202251
[`entr(1)`]: http://eradman.com/entrproject/
252+
[GNU Make]: https://www.gnu.org/software/make/
203253
[ruff format]: https://docs.astral.sh/ruff/formatter/
204254
[ruff]: https://ruff.rs
205255
[mypy]: http://mypy-lang.org/

docs/project/releasing.md

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
## Release Process
44

55
Use this page when you are preparing a g release. Tags trigger publishing to
6-
PyPI via OIDC trusted publishing, so create and push them only when you intend
7-
to publish.
6+
[PyPI] via [OIDC] trusted publishing, so create and push them only when you
7+
intend to publish.
88

99
1. Update `CHANGES` with the release notes
1010

@@ -18,13 +18,22 @@ to publish.
1818
$ git tag v<version>
1919
```
2020

21-
5. Push the branch and tag:
21+
5. Push the branch:
2222

2323
```console
24-
$ git push && git push --tags
24+
$ git push
2525
```
2626

27-
6. CI builds and publishes to PyPI automatically
27+
6. Push the tag:
28+
29+
```console
30+
$ git push --tags
31+
```
32+
33+
7. CI builds and publishes to PyPI automatically
2834

2935
For AI agents: do not create or push tags unless the user explicitly asks.
3036
Prepare the release files and commit only.
37+
38+
[OIDC]: https://openid.net/developers/how-connect-works/
39+
[PyPI]: https://pypi.org/

docs/quickstart.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ $ uv add g
5050

5151
### Developmental releases
5252

53-
New versions of g are published to PyPI as alpha, beta, or release candidates.
53+
New versions of g are published to [PyPI] as alpha, beta, or release candidates.
5454
In their versions you will see notification like `a1`, `b1`, and `rc1`, respectively.
5555
`1.10.0b4` would mean the 4th beta release of `1.10.0` before general availability.
5656

@@ -120,6 +120,7 @@ For unreleased trunk builds, expect breakage:
120120

121121
[pip]: https://pip.pypa.io/en/stable/
122122
[pipx]: https://pypa.github.io/pipx/docs/
123+
[PyPI]: https://pypi.org/
123124
[uv]: https://docs.astral.sh/uv/
124125
[uv-tools]: https://docs.astral.sh/uv/concepts/tools/
125126
[uvx]: https://docs.astral.sh/uv/guides/tools/

0 commit comments

Comments
 (0)