|
| 1 | +--- |
| 2 | +orphan: true |
| 3 | +--- |
| 4 | + |
| 5 | +# Badge & Role Demo |
| 6 | + |
| 7 | +A showcase of the custom Sphinx roles and visual elements available in libtmux-mcp documentation. |
| 8 | + |
| 9 | +## Safety badges |
| 10 | + |
| 11 | +Standalone badges via `{badge}`: |
| 12 | + |
| 13 | +- {badge}`readonly` — green, read-only operations |
| 14 | +- {badge}`mutating` — amber, state-changing operations |
| 15 | +- {badge}`destructive` — red, irreversible operations |
| 16 | + |
| 17 | +## Tool references |
| 18 | + |
| 19 | +### `{tool}` — code-linked with badge |
| 20 | + |
| 21 | +{tool}`capture-pane` · {tool}`send-keys` · {tool}`search-panes` · {tool}`wait-for-text` · {tool}`kill-pane` · {tool}`create-session` · {tool}`split-window` |
| 22 | + |
| 23 | +### `{toolref}` — code-linked, no badge |
| 24 | + |
| 25 | +{toolref}`capture-pane` · {toolref}`send-keys` · {toolref}`search-panes` · {toolref}`wait-for-text` · {toolref}`kill-pane` · {toolref}`create-session` · {toolref}`split-window` |
| 26 | + |
| 27 | +### `{ref}` — plain text link |
| 28 | + |
| 29 | +{ref}`capture-pane` · {ref}`send-keys` · {ref}`search-panes` · {ref}`wait-for-text` · {ref}`kill-pane` · {ref}`create-session` · {ref}`split-window` |
| 30 | + |
| 31 | +## Badges in context |
| 32 | + |
| 33 | +### In a heading |
| 34 | + |
| 35 | +These are the actual tool headings as they render on tool pages: |
| 36 | + |
| 37 | +> `capture_pane` {badge}`readonly` |
| 38 | +
|
| 39 | +> `split_window` {badge}`mutating` |
| 40 | +
|
| 41 | +> `kill_session` {badge}`destructive` |
| 42 | +
|
| 43 | +### In a table |
| 44 | + |
| 45 | +| Tool | Tier | Description | |
| 46 | +|------|------|-------------| |
| 47 | +| {toolref}`list-sessions` | {badge}`readonly` | List all sessions | |
| 48 | +| {toolref}`send-keys` | {badge}`mutating` | Send commands to a pane | |
| 49 | +| {toolref}`kill-pane` | {badge}`destructive` | Destroy a pane | |
| 50 | + |
| 51 | +### In prose |
| 52 | + |
| 53 | +Use {tool}`search-panes` to find text across all panes. If you know which pane, use {tool}`capture-pane` instead. After running a command with {tool}`send-keys`, always {tool}`wait-for-text` before capturing. |
| 54 | + |
| 55 | +### Dense inline (toolref, no badges) |
| 56 | + |
| 57 | +The fundamental pattern: {toolref}`send-keys` → {toolref}`wait-for-text` → {toolref}`capture-pane`. For discovery: {toolref}`list-sessions` → {toolref}`list-panes` → {toolref}`get-pane-info`. |
| 58 | + |
| 59 | +## Environment variable references |
| 60 | + |
| 61 | +{envvar}`LIBTMUX_SOCKET` · {envvar}`LIBTMUX_SAFETY` · {envvar}`LIBTMUX_SOCKET_PATH` · {envvar}`LIBTMUX_TMUX_BIN` |
| 62 | + |
| 63 | +## Glossary terms |
| 64 | + |
| 65 | +{term}`SIGINT` · {term}`SIGQUIT` · {term}`MCP` · {term}`Safety tier` · {term}`Pane` · {term}`Session` |
| 66 | + |
| 67 | +## Admonitions |
| 68 | + |
| 69 | +```{tip} |
| 70 | +Use {tool}`search-panes` before {tool}`capture-pane` when you don't know which pane has the output you need. |
| 71 | +``` |
| 72 | + |
| 73 | +```{warning} |
| 74 | +Do not call {toolref}`capture-pane` immediately after {toolref}`send-keys` — there is a race condition. Use {toolref}`wait-for-text` between them. |
| 75 | +``` |
| 76 | + |
| 77 | +```{note} |
| 78 | +All tools accept an optional `socket_name` parameter for multi-server support. |
| 79 | +``` |
| 80 | + |
| 81 | +## Badge anatomy |
| 82 | + |
| 83 | +Each badge renders as: |
| 84 | + |
| 85 | +```html |
| 86 | +<span class="sd-badge sd-bg-success" |
| 87 | + role="note" |
| 88 | + aria-label="Safety tier: readonly"> |
| 89 | + 🔍 readonly |
| 90 | +</span> |
| 91 | +``` |
| 92 | + |
| 93 | +Features: |
| 94 | +- **Emoji icon** — 🔍 readonly, ✏️ mutating, 💣 destructive (native system emoji, no filters) |
| 95 | +- **Matte colors** — forest green, smoky amber, matte crimson with 1px border |
| 96 | +- **Accessible** — `role="note"` + `aria-label` for screen readers |
| 97 | +- **Non-selectable** — `user-select: none` so copying tool names skips badge text |
| 98 | +- **Context-aware sizing** — slightly larger in headings, smaller inline |
| 99 | +- **Sidebar compression** — badges collapse to colored dots in the right-side TOC |
| 100 | +- **Heading flex** — `h2/h3/h4:has(.sd-badge)` centers badge against cap-height |
0 commit comments