Skip to content

Commit 5f13d4b

Browse files
committed
docs: Add inline {.prompt} dialog for user-to-LLM prompts
Enable MyST attrs_inline extension for [content]{.class} syntax. This allows full nested markup (code, links, bold) inside inline styled spans — something standard Sphinx roles can't do. - Add span.prompt CSS: italic text + curly quote marks via ::before/::after - Apply to prompting guide tables (effective patterns + anti-patterns) - WCAG AA contrast preserved via --color-foreground-primary/muted Syntax: [Run `pytest` in my build pane]{.prompt} Renders: "Run `pytest` in my build pane" (italic, styled quotes)
1 parent 20094cf commit 5f13d4b

3 files changed

Lines changed: 32 additions & 10 deletions

File tree

docs/_static/css/custom.css

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,27 @@ div.admonition.agent-thought > p:last-child {
246246
margin-bottom: 0;
247247
}
248248

249+
/* ── Inline prompt dialog ────────────────────────────────
250+
* Inline styled span for user-to-LLM prompts. Supports
251+
* full nested markup via MyST attrs_inline extension:
252+
* [Run `pytest` in my build pane]{.prompt}
253+
* No line-height or word-wrap disruption. WCAG AA contrast.
254+
* ────────────────────────────────────────────────────────── */
255+
span.prompt {
256+
font-style: italic;
257+
color: var(--color-foreground-primary);
258+
}
259+
260+
span.prompt::before {
261+
content: "\201C";
262+
color: var(--color-foreground-muted);
263+
}
264+
265+
span.prompt::after {
266+
content: "\201D";
267+
color: var(--color-foreground-muted);
268+
}
269+
249270
/* ── Labeled code panels ─────────────────────────────────
250271
* Copyable prose in labeled dark panels. Two variants:
251272
* .system-prompt — user-authored fragments for AGENTS.md

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"replacements",
5555
"strikethrough",
5656
"linkify",
57+
"attrs_inline",
5758
]
5859

5960
templates_path = ["_templates"]

docs/topics/prompting.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,21 @@ These natural-language prompts reliably trigger the right tool sequences:
3636

3737
| Prompt | Agent interprets as |
3838
|--------|-------------------|
39-
| "Run `pytest` in my build pane and show results" | {toolref}`send-keys` → {toolref}`wait-for-text` → {toolref}`capture-pane` |
40-
| "Start the dev server and wait until it's ready" | {toolref}`send-keys` → {toolref}`wait-for-text` (for "listening on") |
41-
| "Check if any pane has errors" | {toolref}`search-panes` with pattern "error" |
42-
| "Set up a workspace with editor, server, and tests" | {toolref}`create-session` → {toolref}`split-window` (x2) → {toolref}`set-pane-title` (x3) |
43-
| "What's running in my tmux sessions?" | {toolref}`list-sessions` → {toolref}`list-panes` → {toolref}`capture-pane` |
44-
| "Kill the old workspace session" | {toolref}`kill-session` (after confirming target) |
39+
| [Run `pytest` in my build pane and show results]{.prompt} | {toolref}`send-keys` → {toolref}`wait-for-text` → {toolref}`capture-pane` |
40+
| [Start the dev server and wait until it's ready]{.prompt} | {toolref}`send-keys` → {toolref}`wait-for-text` (for "listening on") |
41+
| [Check if any pane has errors]{.prompt} | {toolref}`search-panes` with pattern "error" |
42+
| [Set up a workspace with editor, server, and tests]{.prompt} | {toolref}`create-session` → {toolref}`split-window` (x2) → {toolref}`set-pane-title` (x3) |
43+
| [What's running in my tmux sessions?]{.prompt} | {toolref}`list-sessions` → {toolref}`list-panes` → {toolref}`capture-pane` |
44+
| [Kill the old workspace session]{.prompt} | {toolref}`kill-session` (after confirming target) |
4545

4646
## Anti-patterns to avoid
4747

4848
| Prompt | Problem | Better version |
4949
|--------|---------|---------------|
50-
| "Run this command" | Ambiguous — agent may use its own shell instead of tmux | "Run `make test` in a tmux pane" |
51-
| "Check my terminal" | Which pane? Agent must discover first | "Check the pane running `npm dev`" or "Search all panes for errors" |
52-
| "Clean up everything" | Too broad for destructive operations | "Kill the `ci-test` session" |
53-
| "Show me the output" | Capture immediately? Or wait? | "Wait for the command to finish, then show me the output" |
50+
| [Run this command]{.prompt} | Ambiguous — agent may use its own shell instead of tmux | [Run `make test` in a tmux pane]{.prompt} |
51+
| [Check my terminal]{.prompt} | Which pane? Agent must discover first | [Check the pane running `npm dev`]{.prompt} or [Search all panes for errors]{.prompt} |
52+
| [Clean up everything]{.prompt} | Too broad for destructive operations | [Kill the `ci-test` session]{.prompt} |
53+
| [Show me the output]{.prompt} | Capture immediately? Or wait? | [Wait for the command to finish, then show me the output]{.prompt} |
5454

5555
## System prompt fragments
5656

0 commit comments

Comments
 (0)