Skip to content

Commit 567111b

Browse files
committed
docs(redesign): restructure documentation to Library Skeleton pattern
why: The documentation had accumulated organically — test helpers and pytest plugin floated as top-level orphans, API reference files used ambiguous names (servers.md vs libtmux.server.md), internal APIs weren't separated from public ones, and the landing page dumped the full README with no navigation affordance. This restructure follows the Python Documentation Skeletons spec where api/ is the primary reference surface for a library package. what: Structure: - Rename api/ reference files to libtmux.<module>.md format (10 files) - Move test-helpers/ and pytest-plugin/ under api/ as auxiliary public API surfaces - Restructure internals/ with api/ subdirectory using libtmux._internal.*.md naming - Create project/ directory (contributing, code-style, releasing) - Move developing.md to project/contributing.md - Fold about.md content (ID prefixes, naming conventions) into topics/architecture.md New pages: - api/public-api.md — stability contract, pre-1.0 semver policy, deprecation process - api/compatibility.md — Python/tmux/platform support matrix - api/deprecations.md — active deprecation tracker - topics/architecture.md — module hierarchy, data flow, internal identifiers (merged from about.md) - topics/configuration.md — env vars, format handling - topics/design-decisions.md — ORM rationale, format strings, neo.py - topics/public-vs-internal.md — boundary philosophy, promotion path - project/code-style.md — ruff, mypy, NumPy docstrings - project/releasing.md — git tags, OIDC trusted publishing Landing page: - Compose standalone homepage (no README.md include) - One-sentence intro, 2x2 grid cards, 2-command install with pin tip, 6-line code snippet with hierarchy diagram, pytest fixture example Section indexes: - api/index.md: 2x2 Core Objects + 3x2 Supporting Modules card grids - topics/index.md: 2x4 card grid for substantive topic pages - project/index.md: 2x2 card grid for contributor pages Navigation: - Sidebar: Quickstart, Topics, API Reference, Internals, Project, Changelog, Migration, Glossary - 22 redirects for all renamed/moved files - README.md API URLs updated to new libtmux.<module>.html paths Dependencies: - Add sphinx-design to docs and dev dependency groups - Annotate all doc dependencies with documentation site URLs conf.py: - Add sphinx_design extension - Add myst_heading_anchors = 4
1 parent 0ca7749 commit 567111b

40 files changed

+696
-139
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -230,12 +230,12 @@ Session($... ...)
230230

231231
| libtmux object | tmux concept | Notes |
232232
|----------------|-----------------------------|--------------------------------|
233-
| [`Server`](https://libtmux.git-pull.com/api/servers.html) | tmux server / socket | Entry point; owns sessions |
234-
| [`Session`](https://libtmux.git-pull.com/api/sessions.html) | tmux session (`$0`, `$1`,...) | Owns windows |
235-
| [`Window`](https://libtmux.git-pull.com/api/windows.html) | tmux window (`@1`, `@2`,...) | Owns panes |
236-
| [`Pane`](https://libtmux.git-pull.com/api/panes.html) | tmux pane (`%1`, `%2`,...) | Where commands run |
233+
| [`Server`](https://libtmux.git-pull.com/api/libtmux.server.html) | tmux server / socket | Entry point; owns sessions |
234+
| [`Session`](https://libtmux.git-pull.com/api/libtmux.session.html) | tmux session (`$0`, `$1`,...) | Owns windows |
235+
| [`Window`](https://libtmux.git-pull.com/api/libtmux.window.html) | tmux window (`@1`, `@2`,...) | Owns panes |
236+
| [`Pane`](https://libtmux.git-pull.com/api/libtmux.pane.html) | tmux pane (`%1`, `%2`,...) | Where commands run |
237237

238-
Also available: [`Options`](https://libtmux.git-pull.com/api/options.html) and [`Hooks`](https://libtmux.git-pull.com/api/hooks.html) abstractions for tmux configuration.
238+
Also available: [`Options`](https://libtmux.git-pull.com/api/libtmux.options.html) and [`Hooks`](https://libtmux.git-pull.com/api/libtmux.hooks.html) abstractions for tmux configuration.
239239

240240
Collections are live and queryable:
241241

docs/about.md

Lines changed: 0 additions & 100 deletions
This file was deleted.

docs/api/compatibility.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Compatibility
2+
3+
## Python
4+
5+
- **Minimum**: Python 3.10
6+
- **Tested**: Python 3.10, 3.11, 3.12, 3.13
7+
- **Maximum**: Python < 4.0
8+
9+
## tmux
10+
11+
- **Minimum**: tmux 3.2a
12+
- **Tested**: latest stable tmux release
13+
- libtmux uses tmux's format system and control mode -- older tmux versions
14+
may lack required format variables
15+
16+
## Platforms
17+
18+
| Platform | Status |
19+
|----------|--------|
20+
| Linux | Fully supported |
21+
| macOS | Fully supported |
22+
| WSL / WSL2 | Supported (tmux runs inside WSL) |
23+
| Windows (native) | Not supported (tmux does not run natively on Windows) |
24+
25+
## Known Limitations
26+
27+
- tmux must be running and accessible via the default socket or a specified socket
28+
- Some operations require the tmux server to have at least one session
29+
- Format string availability depends on tmux version

docs/api/deprecations.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Deprecations
2+
3+
Active deprecations with timeline and migration paths.
4+
5+
## Active Deprecations
6+
7+
<!-- Pull active deprecations from CHANGES when they exist -->
8+
9+
No active deprecations at this time.
10+
11+
See [history](../history.md) for past changes and the
12+
[migration guide](../migration.md) for upgrading between versions.
13+
14+
## Deprecation Policy
15+
16+
See [Public API -- Deprecation Process](public-api.md#deprecation-process).

docs/api/index.md

Lines changed: 97 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,103 @@
44

55
# API Reference
66

7+
libtmux's public API mirrors tmux's object hierarchy:
8+
9+
```
10+
Server -> Session -> Window -> Pane
11+
```
12+
13+
## Core Objects
14+
15+
::::{grid} 2
16+
:gutter: 3
17+
18+
:::{grid-item-card} Server
19+
:link: libtmux.server
20+
:link-type: doc
21+
Entry point. Manages sessions and executes raw tmux commands.
22+
:::
23+
24+
:::{grid-item-card} Session
25+
:link: libtmux.session
26+
:link-type: doc
27+
Manages windows within a tmux session.
28+
:::
29+
30+
:::{grid-item-card} Window
31+
:link: libtmux.window
32+
:link-type: doc
33+
Manages panes, layouts, and window operations.
34+
:::
35+
36+
:::{grid-item-card} Pane
37+
:link: libtmux.pane
38+
:link-type: doc
39+
Terminal instance. Send keys and capture output.
40+
:::
41+
42+
::::
43+
44+
## Supporting Modules
45+
46+
::::{grid} 3
47+
:gutter: 3
48+
49+
:::{grid-item-card} Common
50+
:link: libtmux.common
51+
:link-type: doc
52+
Base classes and command execution.
53+
:::
54+
55+
:::{grid-item-card} Neo
56+
:link: libtmux.neo
57+
:link-type: doc
58+
Dataclass-based query interface.
59+
:::
60+
61+
:::{grid-item-card} Options
62+
:link: libtmux.options
63+
:link-type: doc
64+
tmux option get/set.
65+
:::
66+
67+
:::{grid-item-card} Hooks
68+
:link: libtmux.hooks
69+
:link-type: doc
70+
tmux hook management.
71+
:::
72+
73+
:::{grid-item-card} Constants
74+
:link: libtmux.constants
75+
:link-type: doc
76+
Format strings and constants.
77+
:::
78+
79+
:::{grid-item-card} Exceptions
80+
:link: libtmux.exc
81+
:link-type: doc
82+
Exception hierarchy.
83+
:::
84+
85+
::::
86+
87+
## Test Utilities
88+
89+
If you're testing code that uses libtmux, see the test helpers and pytest plugin:
90+
91+
```{toctree}
92+
:maxdepth: 1
93+
94+
test-helpers/index
95+
pytest-plugin/index
96+
```
97+
98+
## API Contract
99+
7100
```{toctree}
101+
:maxdepth: 1
8102
9-
properties
10-
servers
11-
sessions
12-
windows
13-
panes
14-
options
15-
hooks
16-
constants
17-
common
18-
exceptions
103+
public-api
104+
compatibility
105+
deprecations
19106
```
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)