Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ $ uvx --from 'cihai-cli' --prerelease allow cihai
_Notes on the upcoming release will go here._
<!-- END PLACEHOLDER - ADD NEW CHANGELOG ENTRIES BELOW THIS LINE -->

### Documentation

#### Clearer documentation links and examples (#354)

Documentation pages now link readers from the first mention of key tools, API
entry points, and command pages to the right reference. The quickstart and
completion pages also keep shell examples copyable by moving explanatory text
into prose, so readers can follow setup steps without editing copied commands.

## cihai-cli 0.34.0 (2026-06-28)

cihai-cli 0.34.0 tracks the latest cihai and unihan-etl releases. The `cihai`
Expand Down
2 changes: 1 addition & 1 deletion MIGRATION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Migration notes

Migration and deprecation notes for cihai-cli are here, see {ref}`changelog` as
Migration and deprecation notes for cihai-cli are here, see {ref}`history` as
well.

```{admonition} Welcome on board! 👋
Expand Down
24 changes: 13 additions & 11 deletions docs/cli/completion.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,27 @@

# Completions

Shell completion lets your shell suggest `cihai` commands and options as you type.

## cihai-cli 0.15+ (experimental)

```{note}
See the [shtab library's documentation on shell completion](https://docs.iterative.ai/shtab/use/#cli-usage) for the most up to date way of connecting completion for cihai-cli.
```

Provisional support for completions in cihai-cli 0.15+ are powered by [shtab](https://docs.iterative.ai/shtab/). This must be **installed separately**, as it's **not currently bundled with cihai-cli**.
Provisional support for completions in cihai-cli 0.15+ is powered by [shtab](https://docs.iterative.ai/shtab/). This must be **installed separately**, as it's **not currently bundled with cihai-cli**.

```console
$ pip install shtab --user
```

Or manage it inside an existing project with uv:
Or manage it inside an existing project with [uv]:

```console
$ uv add --dev shtab
```

Install `shtab` as a user-wide tool with uv:
Install `shtab` as a user-wide tool with [uv]:

```console
$ uv tool install shtab
Expand All @@ -36,6 +38,8 @@ Run it on-demand without installing:
$ uvx shtab
```

Each shell command below points `shtab` at {func}`cihai_cli.cli.create_parser`, the parser factory used by cihai-cli.

:::{tab} bash

```console
Expand Down Expand Up @@ -75,10 +79,8 @@ cihai-cli 0.2 to 0.14 use [click](https://click.palletsprojects.com)'s completio

_~/.bashrc_:

```bash

eval "$(_CIHAI_COMPLETE=bash_source cihai)"

```console
$ eval "$(_CIHAI_COMPLETE=bash_source cihai)"
```

:::
Expand All @@ -87,10 +89,10 @@ eval "$(_CIHAI_COMPLETE=bash_source cihai)"

_~/.zshrc_:

```zsh

eval "$(_CIHAI_COMPLETE=zsh_source cihai)"

```console
$ eval "$(_CIHAI_COMPLETE=zsh_source cihai)"
```

:::

[uv]: https://docs.astral.sh/uv/
1 change: 1 addition & 0 deletions docs/cli/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ completion
:func: create_parser
:prog: cihai
:nosubcommands:
:no-description:

subparser_name : @replace
See :ref:`cli-info`, :ref:`cli-reverse`
Expand Down
4 changes: 2 additions & 2 deletions docs/project/code-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Formatting

cihai-cli uses [ruff](https://github.com/astral-sh/ruff) for both linting and formatting.
cihai-cli uses [Ruff](https://github.com/astral-sh/ruff) for both linting and formatting.

```console
$ uv run ruff format .
Expand All @@ -22,7 +22,7 @@ $ uv run mypy

## Docstrings

All public functions and methods use NumPy-style docstrings.
All public functions and methods use [NumPy-style docstrings](https://numpydoc.readthedocs.io/en/latest/format.html).

## Imports

Expand Down
2 changes: 1 addition & 1 deletion docs/project/contributing.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Contributing

cihai-cli follows the cihai project's contributing guidelines.
cihai-cli follows the [cihai project](https://cihai.git-pull.com/)'s contributing guidelines.

See the [cihai contributing guide](https://cihai.git-pull.com/contributing/) for
development setup, running tests, and submitting pull requests.
Expand Down
2 changes: 1 addition & 1 deletion docs/project/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ How to get involved and submit changes.
:::{grid-item-card} Code Style
:link: code-style
:link-type: doc
Ruff, mypy, NumPy docstrings, import conventions.
[Ruff](https://github.com/astral-sh/ruff), [mypy](https://mypy-lang.org/), [NumPy](https://numpydoc.readthedocs.io/en/latest/format.html) docstrings, import conventions.
:::

:::{grid-item-card} Releasing
Expand Down
15 changes: 10 additions & 5 deletions docs/quickstart.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(usage)=
(quickstart)=

# Usage
# Quickstart

cihai is designed to work out-of-the-box without configuration.

Expand All @@ -10,13 +10,13 @@ cihai is designed to work out-of-the-box without configuration.
$ pip install --user cihai-cli
```

Or manage it inside an existing project with uv:
Or manage it inside an existing project with [uv]:

```console
$ uv add cihai-cli
```

Install the CLI as a user-wide tool with uv:
Install the CLI as a user-wide tool with [uv]:

```console
$ uv tool install cihai-cli
Expand Down Expand Up @@ -44,7 +44,12 @@ the 4th beta release of `1.10.0` before general availability.

```console
$ pipx install --suffix=@next 'cihai-cli' --pip-args '\--pre' --force
// Usage: cihai@next info 好
```

Run that prerelease command as `cihai@next`:

```console
$ cihai@next info 好
```

- [uv tool install][uv-tools]\:
Expand Down
2 changes: 1 addition & 1 deletion src/cihai_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def setup_logger(

Parameters
----------
logger : :py:class:`Logger`
logger : :class:`logging.Logger`
Instance of logger, if one set up.
"""
if not logger:
Expand Down