cihai-cli 0.31.0__tar.gz → 0.31.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/.github/workflows/docs.yml +28 -12
  2. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/.github/workflows/tests.yml +9 -7
  3. cihai_cli-0.31.1/.python-version +1 -0
  4. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/.tmuxp.yaml +3 -3
  5. cihai_cli-0.31.1/.tool-versions +3 -0
  6. cihai_cli-0.31.1/AGENTS.md +174 -0
  7. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/CHANGES +22 -1
  8. cihai_cli-0.31.1/CLAUDE.md +1 -0
  9. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/PKG-INFO +2 -2
  10. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/docs/_templates/sidebar/projects.html +1 -1
  11. cihai_cli-0.31.1/docs/justfile +206 -0
  12. cihai_cli-0.31.1/justfile +143 -0
  13. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/pyproject.toml +4 -4
  14. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/src/cihai_cli/__about__.py +1 -1
  15. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/src/cihai_cli/cli.py +4 -4
  16. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/uv.lock +577 -423
  17. cihai_cli-0.31.0/.python-version +0 -1
  18. cihai_cli-0.31.0/.tool-versions +0 -2
  19. cihai_cli-0.31.0/Makefile +0 -64
  20. cihai_cli-0.31.0/docs/Makefile +0 -189
  21. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/.codecov.yml +0 -0
  22. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/.cursor/rules/avoid-debug-loops.mdc +0 -0
  23. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/.cursor/rules/dev-loop.mdc +0 -0
  24. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/.cursor/rules/git-commits.mdc +0 -0
  25. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/.cursor/rules/notes-llms-txt.mdc +0 -0
  26. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/.github/dependabot.yml +0 -0
  27. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/.gitignore +0 -0
  28. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/.prettierrc +0 -0
  29. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/.vim/coc-settings.json +0 -0
  30. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/.windsurfrules +0 -0
  31. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/LICENSE +0 -0
  32. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/MANIFEST.in +0 -0
  33. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/MIGRATION +0 -0
  34. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/README.md +0 -0
  35. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/docs/_static/css/custom.css +0 -0
  36. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/docs/_static/favicon.ico +0 -0
  37. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/docs/_static/img/cihai.svg +0 -0
  38. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/docs/_static/img/icons/icon-128x128.png +0 -0
  39. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/docs/_static/img/icons/icon-144x144.png +0 -0
  40. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/docs/_static/img/icons/icon-152x152.png +0 -0
  41. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/docs/_static/img/icons/icon-192x192.png +0 -0
  42. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/docs/_static/img/icons/icon-384x384.png +0 -0
  43. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/docs/_static/img/icons/icon-512x512-centered.png +0 -0
  44. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/docs/_static/img/icons/icon-512x512.png +0 -0
  45. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/docs/_static/img/icons/icon-72x72.png +0 -0
  46. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/docs/_static/img/icons/icon-96x96.png +0 -0
  47. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/docs/_templates/layout.html +0 -0
  48. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/docs/api.md +0 -0
  49. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/docs/cli/completion.md +0 -0
  50. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/docs/cli/index.md +0 -0
  51. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/docs/cli/info.md +0 -0
  52. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/docs/cli/reverse.md +0 -0
  53. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/docs/conf.py +0 -0
  54. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/docs/history.md +0 -0
  55. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/docs/index.md +0 -0
  56. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/docs/manifest.json +0 -0
  57. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/docs/migration.md +0 -0
  58. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/docs/quickstart.md +0 -0
  59. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/docs/redirects.txt +0 -0
  60. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/src/cihai_cli/__init__.py +0 -0
  61. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/tests/__init__.py +0 -0
  62. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/tests/conftest.py +0 -0
  63. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/tests/fixtures/Unihan_DictionaryIndices.txt +0 -0
  64. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/tests/fixtures/Unihan_DictionaryLikeData.txt +0 -0
  65. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/tests/fixtures/Unihan_IRGSources.txt +0 -0
  66. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/tests/fixtures/Unihan_NumericValues.txt +0 -0
  67. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/tests/fixtures/Unihan_OtherMappings.txt +0 -0
  68. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/tests/fixtures/Unihan_RadicalStrokeCounts.txt +0 -0
  69. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/tests/fixtures/Unihan_Readings.txt +0 -0
  70. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/tests/fixtures/Unihan_Variants.txt +0 -0
  71. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/tests/fixtures/test_config.yml +0 -0
  72. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/tests/test_cli.py +0 -0
  73. {cihai_cli-0.31.0 → cihai_cli-0.31.1}/tox.ini +0 -0
@@ -5,14 +5,19 @@ on:
5
5
  branches:
6
6
  - master
7
7
 
8
+ permissions:
9
+ contents: read
10
+ id-token: write
11
+
8
12
  jobs:
9
13
  build:
10
14
  runs-on: ubuntu-latest
15
+ environment: docs
11
16
  strategy:
12
17
  matrix:
13
18
  python-version: ['3.14']
14
19
  steps:
15
- - uses: actions/checkout@v4
20
+ - uses: actions/checkout@v6
16
21
 
17
22
  - name: Filter changed file paths to outputs
18
23
  uses: dorny/paths-filter@v3.0.2
@@ -35,7 +40,7 @@ jobs:
35
40
  run: echo "PUBLISH=$(echo true)" >> $GITHUB_ENV
36
41
 
37
42
  - name: Install uv
38
- uses: astral-sh/setup-uv@v5
43
+ uses: astral-sh/setup-uv@v7
39
44
  with:
40
45
  enable-cache: true
41
46
 
@@ -45,6 +50,9 @@ jobs:
45
50
  - name: Install dependencies
46
51
  run: uv sync --all-extras --dev
47
52
 
53
+ - name: Install just
54
+ uses: extractions/setup-just@v3
55
+
48
56
  - name: Print python versions
49
57
  if: env.PUBLISH == 'true'
50
58
  run: |
@@ -54,19 +62,27 @@ jobs:
54
62
  - name: Build documentation
55
63
  if: env.PUBLISH == 'true'
56
64
  run: |
57
- pushd docs; make SPHINXBUILD='uv run sphinx-build' html; popd
65
+ cd docs && just html
58
66
 
59
- - name: Push documentation to S3
67
+ - name: Configure AWS Credentials
60
68
  if: env.PUBLISH == 'true'
61
- uses: jakejarvis/s3-sync-action@v0.5.1
69
+ uses: aws-actions/configure-aws-credentials@v5
62
70
  with:
63
- args: --acl public-read --follow-symlinks --delete
64
- env:
65
- AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
66
- AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
67
- AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
68
- AWS_REGION: 'us-west-1' # optional: defaults to us-east-1
69
- SOURCE_DIR: 'docs/_build/html' # optional: defaults to entire repository
71
+ role-to-assume: ${{ secrets.CIHAI_CLI_DOCS_ROLE_ARN }}
72
+ aws-region: us-east-1
73
+
74
+ - name: Push documentation to S3
75
+ if: env.PUBLISH == 'true'
76
+ run: |
77
+ aws s3 sync docs/_build/html "s3://${{ secrets.CIHAI_CLI_DOCS_BUCKET }}" \
78
+ --delete --follow-symlinks
79
+
80
+ - name: Invalidate CloudFront
81
+ if: env.PUBLISH == 'true'
82
+ run: |
83
+ aws cloudfront create-invalidation \
84
+ --distribution-id "${{ secrets.CIHAI_CLI_DOCS_DISTRIBUTION }}" \
85
+ --paths "/index.html" "/objects.inv" "/searchindex.js"
70
86
 
71
87
  - name: Purge cache on Cloudflare
72
88
  if: env.PUBLISH == 'true'
@@ -11,10 +11,10 @@ jobs:
11
11
  matrix:
12
12
  python-version: ['3.14']
13
13
  steps:
14
- - uses: actions/checkout@v4
14
+ - uses: actions/checkout@v6
15
15
 
16
16
  - name: Install uv
17
- uses: astral-sh/setup-uv@v5
17
+ uses: astral-sh/setup-uv@v7
18
18
  with:
19
19
  enable-cache: true
20
20
 
@@ -49,16 +49,19 @@ jobs:
49
49
  runs-on: ubuntu-latest
50
50
  needs: build
51
51
  if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
52
+ permissions:
53
+ id-token: write
54
+ attestations: write
52
55
 
53
56
  strategy:
54
57
  matrix:
55
58
  python-version: ['3.14']
56
59
 
57
60
  steps:
58
- - uses: actions/checkout@v4
61
+ - uses: actions/checkout@v6
59
62
 
60
63
  - name: Install uv
61
- uses: astral-sh/setup-uv@v5
64
+ uses: astral-sh/setup-uv@v7
62
65
  with:
63
66
  enable-cache: true
64
67
 
@@ -74,6 +77,5 @@ jobs:
74
77
  - name: Publish package
75
78
  uses: pypa/gh-action-pypi-publish@release/v1
76
79
  with:
77
- user: __token__
78
- password: ${{ secrets.PYPI_API_TOKEN }}
79
- skip_existing: true
80
+ attestations: true
81
+ skip-existing: true
@@ -0,0 +1 @@
1
+ 3.14
@@ -9,8 +9,8 @@ windows:
9
9
  panes:
10
10
  - focus: true
11
11
  - pane
12
- - make watch_mypy
13
- - make start
12
+ - just watch-mypy
13
+ - just start
14
14
  - window_name: docs
15
15
  layout: main-horizontal
16
16
  options:
@@ -20,4 +20,4 @@ windows:
20
20
  - focus: true
21
21
  - pane
22
22
  - pane
23
- - make start
23
+ - just start
@@ -0,0 +1,3 @@
1
+ just 1.46.0
2
+ uv 0.9.26
3
+ python 3.14 3.13.11 3.12.12 3.11.14 3.10.19
@@ -0,0 +1,174 @@
1
+ # AGENTS.md
2
+
3
+ Guidance for AI agents (Cursor, Claude Code, Copilot, etc.) working in this repository.
4
+
5
+ ## CRITICAL REQUIREMENTS
6
+
7
+ ### Test Success
8
+ - ALL tests must pass (unit, doctest, lint, type checks) before declaring work complete.
9
+ - Do not describe code as "working" if any test fails.
10
+ - Fix regressions rather than disabling or skipping tests unless explicitly approved.
11
+
12
+ ## Project Overview
13
+
14
+ gp-libs is the shared tooling stack used across the git-pull ecosystem. This repository, `cihai-cli`, is a command-line interface built on top of the `cihai` library to explore the Unihan (CJK) character database. Key abilities:
15
+ - Lookup CJK characters with `cihai info <char>` and YAML-formatted output.
16
+ - Reverse search definitions with `cihai reverse <term>`.
17
+ - Bootstraps and queries the Unihan dataset via `cihai` / `unihan-etl`.
18
+ - Provides a small, typed argparse-based CLI (`src/cihai_cli/cli.py`) exposed as the `cihai` entry point.
19
+
20
+ ## Development Environment
21
+
22
+ This project uses:
23
+ - Python 3.10+
24
+ - [uv](https://github.com/astral-sh/uv) for dependency and task execution
25
+ - [ruff](https://github.com/astral-sh/ruff) for linting/formatting
26
+ - [mypy](https://github.com/python/mypy) with strict settings
27
+ - [pytest](https://docs.pytest.org/) (+ doctests) for testing
28
+ - [gp-libs](https://github.com/gp-libs/gp-libs) for shared docs/testing helpers
29
+ - Sphinx (Furo) for documentation
30
+
31
+ ## Common Commands
32
+
33
+ ### Setup
34
+ ```bash
35
+ # Install dependencies (editable)
36
+ uv pip install --editable .
37
+ uv pip sync
38
+
39
+ # Install with dev extras
40
+ uv pip install --editable . -G dev
41
+ ```
42
+
43
+ ### Tests
44
+ ```bash
45
+ just test # or: uv run pytest
46
+ uv run pytest tests/test_cli.py # single file
47
+ uv run pytest tests/test_cli.py::test_info_command # single test
48
+
49
+ just start # run tests then watch with pytest-watcher
50
+ uv run ptw . # standalone watcher (doctests enabled by default)
51
+ ```
52
+
53
+ ### Linting & Types
54
+ ```bash
55
+ just ruff # uv run ruff check .
56
+ just ruff-format # uv run ruff format .
57
+ uv run ruff check . --fix --show-fixes
58
+
59
+ just mypy # strict type checking
60
+ ```
61
+
62
+ ### Documentation
63
+ ```bash
64
+ just build-docs # build Sphinx HTML in docs/_build
65
+ just start-docs # autobuild + livereload
66
+ just design-docs # update CSS/JS assets
67
+ ```
68
+
69
+ ### Workflow (recommended)
70
+ 1) `uv run ruff format .`
71
+ 2) `uv run pytest`
72
+ 3) `uv run ruff check . --fix --show-fixes`
73
+ 4) `uv run mypy`
74
+ 5) `uv run pytest` (verify clean)
75
+
76
+ ## Code Architecture (quick map)
77
+ - `src/cihai_cli/cli.py`: argparse entrypoint, implements `info` and `reverse` commands, logging setup.
78
+ - `src/cihai_cli/__about__.py`: package metadata (`__version__`).
79
+ - Tests: `tests/` (unit) plus doctests in `src/` and `docs/`.
80
+ - Docs: `docs/` Sphinx project (Furo theme).
81
+
82
+ ## Testing Strategy
83
+ - Pytest with doctests enabled (`addopts` in `pyproject.toml`).
84
+ - Prefer real `cihai` / `unihan_etl` integration over heavy mocking; reuse fixtures where present.
85
+ - Watch mode: `uv run ptw .` (used in `just start`).
86
+ - Coverage via `pytest-cov`; configuration in `pyproject.toml`.
87
+ - Prefer fixtures over mocks (`server`, `session`, etc. when available); use `tmp_path` over `tempfile`, `monkeypatch` over `unittest.mock`.
88
+
89
+ ## Coding Standards
90
+ - `from __future__ import annotations` required; enforced by ruff.
91
+ - Namespace imports for stdlib/typing (`import typing as t`); third-party packages may use `from X import Y`.
92
+ - Docstrings follow NumPy style (see `tool.ruff.lint.pydocstyle`).
93
+ - Python target version: 3.10 (`tool.ruff.target-version`).
94
+ - Keep CLI output human-friendly YAML; avoid breaking existing flags/args.
95
+ - Doctests: keep concise, narrative Examples blocks; move complex flows to `tests/examples/`.
96
+
97
+ ## Documentation Standards
98
+
99
+ ### Code Blocks in Documentation
100
+
101
+ When writing documentation (README, CHANGES, docs/), follow these rules for code blocks:
102
+
103
+ **One command per code block.** This makes commands individually copyable.
104
+
105
+ **Put explanations outside the code block**, not as comments inside.
106
+
107
+ Good:
108
+
109
+ Run the tests:
110
+
111
+ ```console
112
+ $ uv run pytest
113
+ ```
114
+
115
+ Run with coverage:
116
+
117
+ ```console
118
+ $ uv run pytest --cov
119
+ ```
120
+
121
+ Bad:
122
+
123
+ ```console
124
+ # Run the tests
125
+ $ uv run pytest
126
+
127
+ # Run with coverage
128
+ $ uv run pytest --cov
129
+ ```
130
+
131
+ ## Debugging Tips
132
+ - Lean on `pytest -k <pattern> -vv` for focused failures.
133
+ - For CLI behavior, run `uv run cihai info 好` or `uv run cihai reverse library`.
134
+ - If Unihan DB is missing, CLI bootstraps automatically; avoid altering that flow unless required.
135
+ - Stuck in loops? Pause, minimize to a minimal repro, document exact errors, and restate the hypothesis before another attempt.
136
+
137
+ ## Git Commit Standards
138
+
139
+ Commit subjects: `Component/File(commit-type[scope]): Concise description`
140
+
141
+ Body template:
142
+ ```
143
+ why: Reason or impact.
144
+ what:
145
+ - Key technical changes
146
+ - Single topic only
147
+ ```
148
+
149
+ Guidelines:
150
+ - Subject ≤50 chars; body lines ≤72 chars; imperative mood.
151
+ - One topic per commit; separate subject and body with a blank line.
152
+ - Mark breaking changes with `BREAKING:` and include related issue refs when relevant.
153
+
154
+ Common commit types:
155
+ - **feat**: New features or enhancements
156
+ - **fix**: Bug fixes
157
+ - **refactor**: Code restructuring without functional change
158
+ - **docs**: Documentation updates
159
+ - **chore**: Maintenance (dependencies, tooling, config)
160
+ - **test**: Test-related updates
161
+ - **style**: Code style and formatting
162
+ - **py(deps)**: Dependencies
163
+ - **py(deps[dev])**: Dev dependencies
164
+ - **ai(rules[LLM type])**: AI rule updates (e.g., `ai(rules[AGENTS])`)
165
+
166
+ ## Notes & Docs Authoring
167
+ - For `notes/**/*.md`, keep content concise and well-structured (headings, bullets, code fences).
168
+ - Use clear link text `[Title](mdc:URL)` and avoid redundancy; follow llms.txt style when possible.
169
+
170
+ ## References
171
+ - Project docs: https://cihai-cli.git-pull.com
172
+ - Library docs: https://cihai.git-pull.com
173
+ - Unihan dataset: https://www.unicode.org/charts/unihan.html
174
+ - Shared tooling: https://github.com/gp-libs/gp-libs
@@ -32,7 +32,28 @@ $ uvx --from 'cihai-cli' --prerelease allow cihai
32
32
 
33
33
  <!-- Maintainers, insert changes / features for the next release here -->
34
34
 
35
- - _Changes for the upcoming release go here._
35
+ _Add your latest changes from PRs here_
36
+
37
+ ## cihai-cli 0.31.1 (2026-01-24)
38
+
39
+ ### Breaking changes
40
+
41
+ - Bump cihai 0.36.0 -> 0.36.1 (#338)
42
+
43
+ ### CI
44
+
45
+ - Migrate to PyPI Trusted Publisher (#332)
46
+
47
+ ### Development
48
+
49
+ #### Makefile -> Justfile (#333)
50
+
51
+ - Migrate from `Makefile` to `justfile` for running development tasks
52
+ - Update documentation to reference `just` commands
53
+
54
+ ### Documentation
55
+
56
+ - Migrate docs deployment to AWS OIDC authentication and AWS CLI
36
57
 
37
58
  ## cihai-cli 0.31.0 (2025-11-01)
38
59
 
@@ -0,0 +1 @@
1
+ AGENTS.md
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cihai-cli
3
- Version: 0.31.0
3
+ Version: 0.31.1
4
4
  Summary: Command line frontend for the cihai CJK language library
5
5
  Project-URL: Bug Tracker, https://github.com/cihai/cihai-cli/issues
6
6
  Project-URL: Documentation, https://cihai-cli.git-pull.com
@@ -28,7 +28,7 @@ Classifier: Topic :: Software Development :: Localization
28
28
  Classifier: Topic :: System :: Shells
29
29
  Classifier: Topic :: Utilities
30
30
  Requires-Python: <4.0,>=3.10
31
- Requires-Dist: cihai~=0.36.0
31
+ Requires-Dist: cihai~=0.36.1
32
32
  Requires-Dist: pyyaml
33
33
  Description-Content-Type: text/markdown
34
34
 
@@ -49,7 +49,7 @@
49
49
  <p class="indented-block">
50
50
  <span class="project-name">web</span>
51
51
  <span class="indent">
52
- <a class="internal" href="https://social-embed.git-pull.com" class="current">social-embed</a>
52
+ <a class="internal" href="https://social-embed.org" class="current">social-embed</a>
53
53
  </span>
54
54
  </p>
55
55
  </div>
@@ -0,0 +1,206 @@
1
+ # justfile for cihai-cli documentation
2
+ # https://just.systems/
3
+
4
+ set shell := ["bash", "-uc"]
5
+
6
+ # Configuration
7
+ http_port := "8037"
8
+ builddir := "_build"
9
+ sphinxopts := ""
10
+ sphinxbuild := "uv run sphinx-build"
11
+ sourcedir := "."
12
+
13
+ # File patterns for watching
14
+ watch_files := "find .. -type f -not -path '*/\\.*' | grep -i '.*[.]\\(rst\\|md\\)$\\|.*[.]py$\\|CHANGES\\|TODO\\|.*conf\\.py' 2> /dev/null"
15
+
16
+ # Sphinx options
17
+ allsphinxopts := "-d " + builddir + "/doctrees " + sphinxopts + " ."
18
+
19
+ # List all available commands
20
+ default:
21
+ @just --list
22
+
23
+ # Build HTML documentation
24
+ [group: 'build']
25
+ html:
26
+ {{ sphinxbuild }} -b html {{ allsphinxopts }} {{ builddir }}/html
27
+ @echo ""
28
+ @echo "Build finished. The HTML pages are in {{ builddir }}/html."
29
+
30
+ # Build directory HTML files
31
+ [group: 'build']
32
+ dirhtml:
33
+ {{ sphinxbuild }} -b dirhtml {{ allsphinxopts }} {{ builddir }}/dirhtml
34
+ @echo ""
35
+ @echo "Build finished. The HTML pages are in {{ builddir }}/dirhtml."
36
+
37
+ # Build single HTML file
38
+ [group: 'build']
39
+ singlehtml:
40
+ {{ sphinxbuild }} -b singlehtml {{ allsphinxopts }} {{ builddir }}/singlehtml
41
+ @echo ""
42
+ @echo "Build finished. The HTML page is in {{ builddir }}/singlehtml."
43
+
44
+ # Build EPUB
45
+ [group: 'build']
46
+ epub:
47
+ {{ sphinxbuild }} -b epub {{ allsphinxopts }} {{ builddir }}/epub
48
+ @echo ""
49
+ @echo "Build finished. The epub file is in {{ builddir }}/epub."
50
+
51
+ # Build LaTeX files
52
+ [group: 'build']
53
+ latex:
54
+ {{ sphinxbuild }} -b latex {{ allsphinxopts }} {{ builddir }}/latex
55
+ @echo ""
56
+ @echo "Build finished; the LaTeX files are in {{ builddir }}/latex."
57
+
58
+ # Build PDF via LaTeX
59
+ [group: 'build']
60
+ latexpdf:
61
+ {{ sphinxbuild }} -b latex {{ allsphinxopts }} {{ builddir }}/latex
62
+ @echo "Running LaTeX files through pdflatex..."
63
+ make -C {{ builddir }}/latex all-pdf
64
+ @echo "pdflatex finished; the PDF files are in {{ builddir }}/latex."
65
+
66
+ # Build plain text files
67
+ [group: 'build']
68
+ text:
69
+ {{ sphinxbuild }} -b text {{ allsphinxopts }} {{ builddir }}/text
70
+ @echo ""
71
+ @echo "Build finished. The text files are in {{ builddir }}/text."
72
+
73
+ # Build man pages
74
+ [group: 'build']
75
+ man:
76
+ {{ sphinxbuild }} -b man {{ allsphinxopts }} {{ builddir }}/man
77
+ @echo ""
78
+ @echo "Build finished. The manual pages are in {{ builddir }}/man."
79
+
80
+ # Build JSON output
81
+ [group: 'build']
82
+ json:
83
+ {{ sphinxbuild }} -b json {{ allsphinxopts }} {{ builddir }}/json
84
+ @echo ""
85
+ @echo "Build finished; now you can process the JSON files."
86
+
87
+ # Clean build directory
88
+ [group: 'misc']
89
+ [confirm]
90
+ clean:
91
+ rm -rf {{ builddir }}/*
92
+
93
+ # Build HTML help files
94
+ [group: 'misc']
95
+ htmlhelp:
96
+ {{ sphinxbuild }} -b htmlhelp {{ allsphinxopts }} {{ builddir }}/htmlhelp
97
+ @echo ""
98
+ @echo "Build finished; now you can run HTML Help Workshop with the .hhp project file in {{ builddir }}/htmlhelp."
99
+
100
+ # Build Qt help files
101
+ [group: 'misc']
102
+ qthelp:
103
+ {{ sphinxbuild }} -b qthelp {{ allsphinxopts }} {{ builddir }}/qthelp
104
+ @echo ""
105
+ @echo "Build finished; now you can run 'qcollectiongenerator' with the .qhcp project file in {{ builddir }}/qthelp."
106
+
107
+ # Build Devhelp files
108
+ [group: 'misc']
109
+ devhelp:
110
+ {{ sphinxbuild }} -b devhelp {{ allsphinxopts }} {{ builddir }}/devhelp
111
+ @echo ""
112
+ @echo "Build finished."
113
+
114
+ # Build Texinfo files
115
+ [group: 'misc']
116
+ texinfo:
117
+ {{ sphinxbuild }} -b texinfo {{ allsphinxopts }} {{ builddir }}/texinfo
118
+ @echo ""
119
+ @echo "Build finished. The Texinfo files are in {{ builddir }}/texinfo."
120
+
121
+ # Build Info files from Texinfo
122
+ [group: 'misc']
123
+ info:
124
+ {{ sphinxbuild }} -b texinfo {{ allsphinxopts }} {{ builddir }}/texinfo
125
+ @echo "Running Texinfo files through makeinfo..."
126
+ make -C {{ builddir }}/texinfo info
127
+ @echo "makeinfo finished; the Info files are in {{ builddir }}/texinfo."
128
+
129
+ # Build gettext catalogs
130
+ [group: 'misc']
131
+ gettext:
132
+ {{ sphinxbuild }} -b gettext {{ sphinxopts }} . {{ builddir }}/locale
133
+ @echo ""
134
+ @echo "Build finished. The message catalogs are in {{ builddir }}/locale."
135
+
136
+ # Check all external links
137
+ [group: 'validate']
138
+ linkcheck:
139
+ {{ sphinxbuild }} -b linkcheck {{ allsphinxopts }} {{ builddir }}/linkcheck
140
+ @echo ""
141
+ @echo "Link check complete; look for any errors in the above output or in {{ builddir }}/linkcheck/output.txt."
142
+
143
+ # Run doctests embedded in documentation
144
+ [group: 'validate']
145
+ doctest:
146
+ {{ sphinxbuild }} -b doctest {{ allsphinxopts }} {{ builddir }}/doctest
147
+ @echo "Testing of doctests in the sources finished, look at the results in {{ builddir }}/doctest/output.txt."
148
+
149
+ # Check build from scratch
150
+ [group: 'validate']
151
+ checkbuild:
152
+ rm -rf {{ builddir }}
153
+ {{ sphinxbuild }} -n -q ./ {{ builddir }}
154
+
155
+ # Build redirects configuration
156
+ [group: 'misc']
157
+ redirects:
158
+ {{ sphinxbuild }} -b rediraffewritediff {{ allsphinxopts }} {{ builddir }}/redirects
159
+ @echo ""
160
+ @echo "Build finished. The redirects are in rediraffe_redirects."
161
+
162
+ # Show changes overview
163
+ [group: 'misc']
164
+ changes:
165
+ {{ sphinxbuild }} -b changes {{ allsphinxopts }} {{ builddir }}/changes
166
+ @echo ""
167
+ @echo "The overview file is in {{ builddir }}/changes."
168
+
169
+ # Watch files and rebuild on change
170
+ [group: 'dev']
171
+ watch:
172
+ #!/usr/bin/env bash
173
+ set -euo pipefail
174
+ if command -v entr > /dev/null; then
175
+ ${{ watch_files }} | entr -c just html
176
+ else
177
+ just html
178
+ fi
179
+
180
+ # Serve documentation via Python http.server
181
+ [group: 'dev']
182
+ serve:
183
+ @echo '=============================================================='
184
+ @echo ''
185
+ @echo 'docs server running at http://localhost:{{ http_port }}/'
186
+ @echo ''
187
+ @echo '=============================================================='
188
+ python -m http.server {{ http_port }} --directory {{ builddir }}/html
189
+
190
+ # Watch and serve simultaneously
191
+ [group: 'dev']
192
+ dev:
193
+ #!/usr/bin/env bash
194
+ set -euo pipefail
195
+ just watch &
196
+ just serve
197
+
198
+ # Start sphinx-autobuild server
199
+ [group: 'dev']
200
+ start:
201
+ uv run sphinx-autobuild "{{ sourcedir }}" "{{ builddir }}" {{ sphinxopts }} --port {{ http_port }}
202
+
203
+ # Design mode: watch static files and disable incremental builds
204
+ [group: 'dev']
205
+ design:
206
+ uv run sphinx-autobuild "{{ sourcedir }}" "{{ builddir }}" {{ sphinxopts }} --port {{ http_port }} --watch "." -a