Skip to content

docs: voice-guide compliance pass, diagrams, and fixes#1072

Merged
tony merged 13 commits into
masterfrom
doc-improvements-pt2
Jun 30, 2026
Merged

docs: voice-guide compliance pass, diagrams, and fixes#1072
tony merged 13 commits into
masterfrom
doc-improvements-pt2

Conversation

@tony

@tony tony commented Jun 30, 2026

Copy link
Copy Markdown
Member

Summary

  • Align every prose page under docs/ and the README with the docs/AGENTS.md voice guide — concept-first leads, second-person voice, "you can stop here" reassurance, advanced/Python material marked opt-in — while preserving every link, cross-reference, table, and error string.
  • Add build-time mermaid and tmux-layout diagrams where prose was carrying structural information: the plugin hook lifecycle, the CLI request flow, the workspace hierarchy, the load attach/append decision, and the freeze→edit→load loop. Diagrams are vertical and tag command/symbol nodes monospace.
  • Modernize the tmux primer (about_tmux) by replacing its aafig ASCII art with mermaid and tmux-layout directives that render to theme-aware inline SVG.
  • Fix cross-references so internal symbols link: tmuxp.workspace.builder, tmuxp.cli, tmuxp.cli.cli(), tmuxp.cli._formatter, and the libtmux Server/Session/Window/Pane objects. The API index gains the same grid-card navigation as every other index page.
  • Fix correctness drift surfaced during the pass: the Python floor (3.9→3.10), makejust throughout the contributor guide, broken include/image paths, leftover reStructuredText link syntax in the quickstart, an unsupported .tmuxp.py claim, and two broken code samples in the plugin guide.
  • Record the diagram and API-page conventions in the docs voice guide so they aren't re-litigated.

Changes by area

Configuration

  • top-level, environmental-variables, examples, index: concept-first leads; a session→window→pane hierarchy diagram; grammar and word fixes.

Topics

  • plugins: rewritten concept-first and marked opt-in; a hook-lifecycle diagram whose firing order is verified against the builder and the load CLI; fixed a Python dict syntax error and an invalid pyproject.toml example.
  • workflows: second-person voice, a freeze→edit→load diagram, a {ref} to the exit-codes page.
  • library-vs-cli, troubleshooting, custom-workspace-builders: internal cross-references, tmux 3.2a3.2, reader-addressed intros.

CLI

  • load: warmer open; an attach/append/detached decision diagram.
  • shell: consolidated the -c material that previously appeared in two non-adjacent sections.
  • completion, exit-codes, freeze, recipes: leads, per-example intros, and cross-references.

Internals

  • architecture: ASCII request flow → mermaid; link the cli module and entry point, _formatter, the classic builder class, and the libtmux objects.
  • api/cli/formatter: new page documenting tmuxp.cli._formatter via automodule, so the module reference resolves to a populated target.
  • api/workspace/builder: register the package as a module target so tmuxp.workspace.builder resolves and links.
  • api/index: grid cards matching the other index pages.

Guides & front matter

  • quickstart: clean MyST (reStructuredText link artifacts removed), Python ≥3.10, dropped the unsupported .tmuxp.py.
  • about_tmux: aafig → mermaid + tmux-layout.
  • glossary: tidied the Server definition.
  • project/contributing: makejust, fixed include/image paths, removed a duplicate clone block and an ownerless TODO.
  • project/releasing: active voice; current Markdown changelog format.
  • README: active tagline; omit the $ prompt from command blocks.

Conventions

  • docs/AGENTS.md: a "Diagrams and reference pages" section — :::cmd monospace nodes and vertical flowchart TD for mermaid, and {eval-rst} automodule for API pages.

Design decisions

  • Audit before rewrite: a read-only pass scored each page against the guide, so already-compliant pages were left untouched, avoiding needless churn.
  • Preserve the precise blocks: the guide separates framing (warm) from facts (exact). Resolution-order lists, value tables, error strings, and {ref}/{class} roles were kept verbatim; only the prose around them changed.
  • Diagrams encode verified facts: the hook-lifecycle and request-flow diagrams assert ordering, so each node and edge was checked against source.
  • Diagram ergonomics: vertical charts scale on narrow viewports, so diagrams are flowchart TD (the architecture fan-out stays wide on purpose); command, symbol, and config-key nodes render monospace via :::cmd.
  • The README omits $ prompts: GitHub renders code blocks without prompt-aware copy, so a leading $ is copied with the command. The README is the sole exception to the console $-prefix convention used in the Sphinx docs.
  • Each commit rebuilds clean: the docs were rebuilt in full before every commit; no new broken references were introduced, and pre-existing broken references in the contributor guide now resolve.

Verification

No reStructuredText reference artifacts remain in the quickstart:

rg -n '\]\_|\]\\:' docs/quickstart.md

No make invocations remain in the contributor guide:

rg -n '\bmake ' docs/project/contributing.md

No aafig blocks remain in the primer:

rg -n 'aafig' docs/about_tmux.md

No leading $ prompts remain in the README:

rg -n '^\s*\$ ' README.md

The builder package is registered as a module target:

rg -n 'py:module:: tmuxp.workspace.builder' docs/internals/api/workspace/builder/index.md

Test plan

  • uv run ruff check . — lint clean
  • uv run ruff format . — no formatting changes
  • uv run mypy — type-check clean
  • uv run py.test — suite green (doctests unaffected)
  • just build-docs — full rebuild succeeds; no new broken references; contributor-guide include/image references now resolve
  • mermaid and tmux-layout directives render to inline SVG; command nodes render monospace
  • cross-references resolve in the rendered HTML: tmuxp.workspace.builder, tmuxp.cli, tmuxp.cli.cli(), tmuxp.cli._formatter, and the libtmux Server/Session/Window/Pane objects

tony added 12 commits June 29, 2026 19:29
why: The configuration pages opened on raw keys instead of what the
feature is, and a skimmer had no "you can stop here" cue. The docs
voice guide asks for concept-first prose addressed to the reader.

what:
- top-level: open with what top-level keys are and that only
  session_name is required; second-person session_name prose
- environmental-variables: add an orientation lead (rarely needed,
  works out of the box)
- examples: add a gallery lead; fix "punctual"->"concise" and a
  stray "it's"->"its"
- index: fix "It's"->"Its"; add a session->window->pane mermaid
why: The topics pages opened in third person about generic "users"
instead of addressing the reader, and the plugin hook order and the
freeze->load loop are far easier to grasp as diagrams than as prose.

what:
- plugins: second-person, concept-first intro; mark plugins
  opt-in/advanced; add a hook-lifecycle mermaid (firing order
  verified against the builder and load CLI); fix a dict-literal
  syntax error and an invalid pyproject example (>=3.8 -> >=3.10,
  tmuxp^=1.7.0 -> tmuxp>=1.7.0, PEP 621 authors)
- workflows: second-person voice, sentence-case headings, a
  freeze->edit->load mermaid, {ref} the exit-codes page
- custom-workspace-builders: address the reader in the intro
- troubleshooting: tmux 3.2a -> 3.2; {ref} completion; bash/zsh/tcsh
- library-vs-cli: link quickstart and examples
why: The command pages opened straight into mechanics, shell
documented -c twice in non-adjacent sections, and the inside-tmux
load choice was described in prose only.

what:
- load: warmer concept-first open; a mermaid for the y/n/a
  switch/append/detached choice
- shell: consolidate the duplicated -c material into one
  "Running code directly" section after interactive usage
- completion: add a concept-first lead naming shtab vs click
- exit-codes: introduce each script example instead of stacking
  them bare
- freeze: Tmuxp -> tmuxp
- recipes: link the full CLI reference
why: The architecture request flow was ASCII art; the workspace
builder reference rendered as dead text because the package had no
module target; and the API index listed its pages as a bare toctree
instead of the grid every other index page uses.

what:
- architecture: ASCII request flow -> mermaid; link the classic
  builder class instead of a stale bare WorkspaceBuilder
- api/workspace/builder: register the package as a py:module so
  {mod}`tmuxp.workspace.builder` resolves and links
- api/index: concept-first lead + grid cards linking each module
  group, matching the other index pages
why: The quickstart still carried reStructuredText link syntax
([uv]_, [pip]\:) that renders broken under MyST, claimed python
>=3.9, and listed a .tmuxp.py config form that tmuxp does not load.

what:
- quickstart: concept-first lead; convert rST references to MyST
  markdown links; one command per console block; python >=3.9 ->
  >=3.10; drop the unsupported .tmuxp.py (only .tmuxp.{yaml,yml,json}
  load); fold the abstraction-layer table under Pythonics
- glossary: tidy the redundant Server definition; "a layouts" ->
  "layouts"
why: The tmux primer drew its session and pane diagrams as aafig
ASCII art. The repo now renders mermaid and tmux-layout to
theme-aware inline SVG, which reads better in light and dark themes.

what:
- session/window/pane hierarchy, window switching, and the
  detach/reattach flow -> mermaid
- the two terminal-split illustrations -> tmux-layout directives
- "stores it own screen" -> "its own screen"
why: contributing documented a make-based workflow, but the repo
uses just; its dev-config include paths and screenshot were one
directory too shallow and never resolved. releasing showed an
outdated rST changelog shape.

what:
- contributing: make -> just throughout (real recipe names); drop a
  duplicated clone block and an ownerless todo; fix the
  tests.yml/.tmuxp.yaml includes and the screenshot path (resolves
  3 build warnings); trim tab boilerplate to single commands
- releasing: active voice; changelog example uses the current
  Markdown "## tmuxp X.Y.Z" form and the fixed subheading order
why: GitHub renders code blocks without prompt-aware copy, so a
leading "$ " is copied along with the command and makes it
uncopyable. The README is the sole exception to the console
$-prefix convention used elsewhere in the docs.

what:
- drop the leading "$ " prompt from every command block
- tagline -> active second person
- "triage and code review and the tracker" -> "code-review on the
  tracker"
why: Left-to-right flowcharts overflow horizontally and do not
scale on narrow or mobile viewports; top-down charts wrap within
the doc column. The architecture request-flow stays LR, where the
fan-out reads better wide.

what:
- workflows freeze->edit->load loop: LR -> TD
- about_tmux window-switch and detach/reattach flows: LR -> TD
why: The architecture page named tmuxp.cli, tmuxp.cli.cli(),
tmuxp.cli._formatter, and the libtmux Server/Session/Window/Pane
objects in plain code, so none of them linked, and _formatter had
no API page to point at.

what:
- architecture: link the cli module and entry point, _formatter,
  and the libtmux objects via {mod}/{func}/{class} roles
- add an api/cli/formatter page (eval-rst automodule) and wire it
  into the toctree, giving {mod}`tmuxp.cli._formatter` a populated
  target
why: Command, symbol, and config-key labels read as code, so they
should render monospace the way inline code does, matching the
workspace-builders diagram's :::cmd nodes.

what:
- tag command/symbol/key nodes with :::cmd across the workflows,
  plugins, configuration, load, and architecture diagrams
- plugins: drop the inline per-hook timing from the nodes so the
  symbol nodes stay clean, and move it into the prose below
why: Review surfaced two conventions worth pinning so they are not
re-litigated: mermaid command nodes should be monospace and
vertical, and API pages need automodule (a bare py:module renders
an empty page).

what:
- add a "Diagrams and reference pages" section: :::cmd + flowchart
  TD for mermaid; {eval-rst} automodule for API reference pages
- add a matching before-you-commit checklist item
@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.56%. Comparing base (9c6bd26) to head (e9b2ef7).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1072   +/-   ##
=======================================
  Coverage   82.56%   82.56%           
=======================================
  Files          31       31           
  Lines        2770     2770           
  Branches      518      518           
=======================================
  Hits         2287     2287           
  Misses        346      346           
  Partials      137      137           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tony tony merged commit a2fb338 into master Jun 30, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant