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
1 change: 0 additions & 1 deletion .github/workflows/cli-drift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ on:
pull_request:
paths:
- 'docs/docs/reference/cli.md'
- 'docs/_data/cli-global-flags.yaml'
- 'scripts/check-cli-drift.py'
- '.github/workflows/cli-drift.yml'
workflow_dispatch:
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,17 @@ jobs:
working-directory: docs
run: poetry run zensical build --strict

# zensical doesn't run Jinja (the macros plugin was silently ignored and
# the CLI page shipped a raw `{% for %}` loop), and --strict doesn't
# notice. Any template syntax left in a built page fails the build.
- name: No unrendered template syntax
working-directory: docs
run: |
if grep -rl --include='*.html' -e '{{ ' -e '{% ' site; then
echo "::error::the pages above contain unrendered {{ }} or {% %}"
exit 1
fi

- name: Upload Pages artifact
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
uses: actions/upload-pages-artifact@v5
Expand Down
9 changes: 0 additions & 9 deletions docs/_data/cli-global-flags.yaml

This file was deleted.

6 changes: 4 additions & 2 deletions docs/docs/reference/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,10 @@ and `lib` mode.

| Flag | Effect |
|---|---|
{% for row in global_flags %}| {{ row.flag }} | {{ row.effect }} |
{% endfor %}
| `-p`, `--path <DIR>` | Run against `<DIR>` instead of the current directory. |
| `-v`, `--verbose` (repeatable: `-vv`, `-vvv`) | Raise log verbosity (info / debug / trace) for `comline-core` diagnostics. |
| `-q`, `--quiet` | Only errors. Conflicts with `-v`. |
| `--plain` | No color, symbols, emoji or spinner — for logs and CI. |

`RUST_LOG` overrides the verbosity flags. `NO_COLOR` strips color. stdout is
reserved for machine output (`completions` and `targets` write there);
Expand Down
6 changes: 1 addition & 5 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,12 +180,8 @@ theme:


# TODO: The social plugin is disabled due to not Cairo lib not being available on Nix
plugins:
# plugins:
# - social
- macros:
include_yaml:
- _data/cli-global-flags.yaml
render_by_default: false

extra:
# social:
Expand Down
75 changes: 1 addition & 74 deletions docs/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion docs/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ pillow = "^12.3.0"
mike = "^2.2.0"
zensical = ">=0.0.57,<0.1.0"
comline-pygments = { path = "pygments-comline", develop = true }
mkdocs-macros-plugin = "^1.5.0"



Expand Down
10 changes: 1 addition & 9 deletions scripts/check-cli-drift.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@

ROOT = Path(__file__).resolve().parent.parent
DOCS_PAGE = ROOT / "docs/docs/reference/cli.md"
# The page's tables may be assembled at build time from `_data/*.yaml` by the
# macros extension, so the documented surface is the page *plus* that data.
DATA_DIR = ROOT / "docs/_data"

# Inherited by every subcommand; documented once under "Global flags".
GLOBAL_FLAGS = {"--path", "--verbose", "--quiet", "--plain"}
Expand Down Expand Up @@ -130,12 +127,7 @@ def main() -> int:
if not DOCS_PAGE.exists():
sys.exit(f"error: {DOCS_PAGE} not found")

sources = [DOCS_PAGE.read_text(encoding="utf-8")]
if DATA_DIR.is_dir():
sources += [
f.read_text(encoding="utf-8") for f in sorted(DATA_DIR.glob("*.yaml"))
]
doc_commands, doc_flags = documented("\n".join(sources))
doc_commands, doc_flags = documented(DOCS_PAGE.read_text(encoding="utf-8"))

root_help = run_help([])
real_commands = parse_commands(root_help)
Expand Down
Loading