Title: docs: Per-parameter configuration reference, generated from a config schema · Issue #1050 · tmux-python/tmuxp · GitHub
Open Graph Title: docs: Per-parameter configuration reference, generated from a config schema · Issue #1050 · tmux-python/tmuxp
X Title: docs: Per-parameter configuration reference, generated from a config schema · Issue #1050 · tmux-python/tmuxp
Description: Problem Workspace configuration keys are documented as narrative sections in docs/configuration/top-level.md and docs/configuration/examples.md. That shape has three costs: No linkable per-parameter target. Issues, PRs, CHANGES entries, ...
Open Graph Description: Problem Workspace configuration keys are documented as narrative sections in docs/configuration/top-level.md and docs/configuration/examples.md. That shape has three costs: No linkable per-paramete...
X Description: Problem Workspace configuration keys are documented as narrative sections in docs/configuration/top-level.md and docs/configuration/examples.md. That shape has three costs: No linkable per-paramete...
Opengraph URL: https://github.com/tmux-python/tmuxp/issues/1050
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"docs: Per-parameter configuration reference, generated from a config schema","articleBody":"## Problem\n\nWorkspace configuration keys are documented as narrative sections in `docs/configuration/top-level.md` and `docs/configuration/examples.md`. That shape has three costs:\n\n- **No linkable per-parameter target.** Issues, PRs, CHANGES entries, and warnings can't point at \"the `synchronize` reference\" — only at a whole page.\n- **No canonical inventory.** The set of valid keys lives implicitly across `loader.expand()`, `loader.trickle()`, `validation.validate_schema()`, and the builder. Discovering \"what can I put in a workspace file, at which level, with what default?\" requires reading source.\n- **Drift risk.** Prose and code are updated separately; the parity work (#1016, #1047–#1049) is adding many new keys (pane titles, `synchronize`, `shell_command_after`, `clear`, lifecycle hooks), which multiplies both the value of a reference and the surface for drift.\n\n## Proposal\n\n### 1. Per-parameter reference pages\n\nOne page (or one anchored section) per config parameter, each carrying:\n\n- Name, **level** (session / window / pane), type, default\n- Version introduced\n- 1–3 prose paragraphs of behavior\n- At least one copy-paste workspace example\n- Related keys / interactions (e.g. `synchronize: after` vs `shell_command_after` ordering)\n\nPlus an index table grouped by level, so the full vocabulary is scannable on one screen.\n\n### 2. Bonus: make them autodocumentable\n\nThe drift problem disappears if docs and validation share one source of truth. Sketch:\n\n1. **Declarative schema registry in code** — a dataclass (or table of records) describing every key: name, level, type, default, since-version, help text, example. `loader`/`validation` consume it instead of hardcoding key knowledge; `validate_schema()` becomes data-driven.\n2. **Sphinx directive that renders the registry** — prior art is exactly this pattern:\n - **myst-parser** documents `MdParserConfig` by introspecting its dataclass fields and `field.metadata[\"help\"]` via a custom `MystConfigDirective`, invoked in docs as a `{myst-config}` fenced directive (`myst_parser/_docs.py`). tmuxp can do the same with a `{tmuxp-config}` directive filterable by level.\n - **Sphinx core** documents its own options with the `confval` directive, which yields stable cross-referenceable targets (`{confval}` role) — adopting `confval`-style object types gives every parameter a permalink usable from CHANGES and warnings.\n3. The generic directive could live in tmuxp's docs `conf.py` initially; if it proves reusable, graduating it to the shared docs platform (gp-sphinx) is a natural follow-up.\n\n### Phasing\n\n1. **Inventory + anchors** — enumerate every key from loader/validation/builder, restructure existing prose under per-key anchors, add the index table. Docs-only, no code changes.\n2. **Schema registry** — introduce the declarative registry; port `validate_schema()` and loader key-handling onto it; doctest the registry.\n3. **Directive** — render per-key reference docs from the registry; delete the now-duplicated hand-written tables; CI ensures a key without registry metadata fails the build.\n\n### Acceptance criteria\n\n- Every workspace config key has a linkable reference target with level, type, default, and a working example\n- The key inventory in docs is generated from (or validated against) the same structure the loader/validator uses\n- Adding a new config key without docs metadata fails loudly (build or test)\n\nRefs #1016 (the parity effort expanding the config surface this would document).","author":{"url":"https://github.com/tony","@type":"Person","name":"tony"},"datePublished":"2026-06-07T14:22:50Z","url":"https://github.com/tmux-python/tmuxp/issues/1050"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:06946717-2b6e-f660-5aab-b4a8cda3ce58 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B70E:2FA100:4E886:6E37A:6B007E53 |
| html-safe-nonce | ecb32328ac736a8d33790717e528ed545020a5127a6abc4076dc6a9d2956a4c9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNzBFOjJGQTEwMDo0RTg4Njo2RTM3QTo2QjAwN0U1MyIsInZpc2l0b3JfaWQiOiIxOTYwNDAxNzE2MjY0MzM2OTc5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 601d028ff1c7b4fc431f4ba050a9ebe79c3d93e741e92b7e7771f8372b99a0f3 |
| hovercard-subject-tag | issue:4607621373 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/tmux-python/tmuxp/1050/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e64724d048437674c73a6a527f0a23466f6414ac17fb962d6d40bd366701aa9e/tmux-python/tmuxp/issues/1050 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e64724d048437674c73a6a527f0a23466f6414ac17fb962d6d40bd366701aa9e/tmux-python/tmuxp/issues/1050 |
| og:image:alt | Problem Workspace configuration keys are documented as narrative sections in docs/configuration/top-level.md and docs/configuration/examples.md. That shape has three costs: No linkable per-paramete... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tony |
| hostname | github.com |
| expected-hostname | github.com |
| None | 82c186f13e104004ab7bdb779f3195e59dd38bfde531aaa74b76470fc2462b83 |
| turbo-cache-control | no-preview |
| go-import | github.com/tmux-python/tmuxp git https://github.com/tmux-python/tmuxp.git |
| octolytics-dimension-user_id | 37234308 |
| octolytics-dimension-user_login | tmux-python |
| octolytics-dimension-repository_id | 12398170 |
| octolytics-dimension-repository_nwo | tmux-python/tmuxp |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 12398170 |
| octolytics-dimension-repository_network_root_nwo | tmux-python/tmuxp |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | d1bc2aa1939001689f5ce935982c10a6138f745c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width