Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

Docs: Tighten content spacing

Maximilian Rooscb9afed8b485
diff --git a/README.md b/README.md
index 27fb06d58..9f333cd7e 100644
--- a/README.md
+++ b/README.md
@@ -462,7 +462,7 @@ HEAD.
<!-- ⚠️ AUTO-GENERATED from `wt switch --help-md` — edit source to update -->
-```text
+```
wt switch — Switch to a worktree
Usage: wt switch [OPTIONS] <BRANCH>
@@ -562,37 +562,37 @@ See `wt config approvals --help`.
Switch to existing worktree:
-```console
+```bash
wt switch feature-branch
```
Create new worktree from main:
-```console
+```bash
wt switch --create new-feature
```
Switch to previous worktree:
-```console
+```bash
wt switch -
```
Create from specific base:
-```console
+```bash
wt switch --create hotfix --base production
```
Create and run command:
-```console
+```bash
wt switch --create docs --execute "code ."
```
Skip hooks during creation:
-```console
+```bash
wt switch --create temp --no-verify
```
@@ -600,7 +600,7 @@ wt switch --create temp --no-verify
Use `@` for current HEAD, `-` for previous, `^` for main:
-```console
+```bash
wt switch @ # Switch to current branch's worktree
wt switch - # Switch to previous worktree
wt switch --create new-feature --base=^ # Branch from main (default)
@@ -617,7 +617,7 @@ wt remove @ # Remove current worktree
<!-- ⚠️ AUTO-GENERATED from `wt merge --help-md` — edit source to update -->
-```text
+```
wt merge — Merge worktree into target branch
Usage: wt merge [OPTIONS] [TARGET]
@@ -707,25 +707,25 @@ See `wt config approvals --help`.
Basic merge to main:
-```console
+```bash
wt merge
```
Merge without squashing:
-```console
+```bash
wt merge --no-squash
```
Keep worktree after merging:
-```console
+```bash
wt merge --no-remove
```
Skip all hooks:
-```console
+```bash
wt merge --no-verify
```
@@ -738,7 +738,7 @@ wt merge --no-verify
<!-- ⚠️ AUTO-GENERATED from `wt remove --help-md` — edit source to update -->
-```text
+```
wt remove — Remove worktree and branch
Usage: wt remove [OPTIONS] [WORKTREES]...
@@ -834,37 +834,37 @@ Stops any git fsmonitor daemon for the worktree before removal. This prevents or
Remove current worktree and branch:
-```console
+```bash
wt remove
```
Remove specific worktree and branch:
-```console
+```bash
wt remove feature-branch
```
Remove worktree but keep branch:
-```console
+```bash
wt remove --no-delete-branch feature-branch
```
Remove multiple worktrees:
-```console
+```bash
wt remove old-feature another-branch
```
Remove in foreground (blocking):
-```console
+```bash
wt remove --no-background feature-branch
```
Switch to default in main:
-```console
+```bash
wt remove # (when already in main worktree)
```
@@ -877,7 +877,7 @@ wt remove # (when already in main worktree)
<!-- ⚠️ AUTO-GENERATED from `wt list --help-md` — edit source to update -->
-```text
+```
wt list — List worktrees and optionally branches
Usage: wt list [OPTIONS]
wt list <COMMAND>
@@ -992,7 +992,7 @@ Note: `locked` and `prunable` are top-level fields on worktree objects, not in s
**Query examples:**
-```console
+```bash
# Find worktrees with conflicts
jq '.[] | select(.status.branch_state == "Conflicts")'
@@ -1021,7 +1021,7 @@ jq '.[] | select(.is_current == true)'
<!-- ⚠️ AUTO-GENERATED from `wt config --help-md` — edit source to update -->
-```text
+```
wt config — Manage configuration and shell integration
Usage: wt config [OPTIONS] <COMMAND>
@@ -1053,19 +1053,19 @@ Global Options:
1. Set up shell integration
- ```console
+ ```bash
wt config shell install
```
Or manually add to the shell config:
- ```console
+ ```bash
eval "$(wt config shell init bash)"
```
2. (Optional) Create user config file
- ```console
+ ```bash
wt config create
```
@@ -1086,7 +1086,7 @@ Global Options:
For Claude:
-```console
+```bash
llm install llm-anthropic
llm keys set anthropic
llm models default claude-haiku-4-5-20251001
@@ -1094,7 +1094,7 @@ llm models default claude-haiku-4-5-20251001
For OpenAI:
-```console
+```bash
llm keys set openai
```
@@ -1122,7 +1122,7 @@ Docs: <https://llm.datasette.io/> | <https://github.com/sigoden/aichat>
<!-- ⚠️ AUTO-GENERATED from `wt step --help-md` — edit source to update -->
-```text
+```
wt step — Workflow building blocks
Usage: wt step [OPTIONS] <COMMAND>
diff --git a/docs/content/commands.md b/docs/content/commands.md
index 996ae681c..41cd1e17a 100644
--- a/docs/content/commands.md
+++ b/docs/content/commands.md
@@ -7,7 +7,7 @@ weight = 6
<!-- ⚠️ AUTO-GENERATED from `wt switch --help-md` — edit source to update -->
-```text
+```
wt switch — Switch to a worktree
Usage: wt switch [OPTIONS] <BRANCH>
@@ -107,37 +107,37 @@ See `wt config approvals --help`.
Switch to existing worktree:
-```console
+```bash
wt switch feature-branch
```
Create new worktree from main:
-```console
+```bash
wt switch --create new-feature
```
Switch to previous worktree:
-```console
+```bash
wt switch -
```
Create from specific base:
-```console
+```bash
wt switch --create hotfix --base production
```
Create and run command:
-```console
+```bash
wt switch --create docs --execute "code ."
```
Skip hooks during creation:
-```console
+```bash
wt switch --create temp --no-verify
```
@@ -145,7 +145,7 @@ wt switch --create temp --no-verify
Use `@` for current HEAD, `-` for previous, `^` for main:
-```console
+```bash
wt switch @ # Switch to current branch's worktree
wt switch - # Switch to previous worktree
wt switch --create new-feature --base=^ # Branch from main (default)
@@ -161,7 +161,7 @@ wt remove @ # Remove current worktree
<!-- ⚠️ AUTO-GENERATED from `wt merge --help-md` — edit source to update -->
-```text
+```
wt merge — Merge worktree into target branch
Usage: wt merge [OPTIONS] [TARGET]
@@ -251,25 +251,25 @@ See `wt config approvals --help`.
Basic merge to main:
-```console
+```bash
wt merge
```
Merge without squashing:
-```console
+```bash
wt merge --no-squash
```
Keep worktree after merging:
-```console
+```bash
wt merge --no-remove
```
Skip all hooks:
-```console
+```bash
wt merge --no-verify
```
@@ -281,7 +281,7 @@ wt merge --no-verify
<!-- ⚠️ AUTO-GENERATED from `wt remove --help-md` — edit source to update -->
-```text
+```
wt remove — Remove worktree and branch
Usage: wt remove [OPTIONS] [WORKTREES]...
@@ -377,37 +377,37 @@ Stops any git fsmonitor daemon for the worktree before removal. This prevents or
Remove current worktree and branch:
-```console
+```bash
wt remove
```
Remove specific worktree and branch:
-```console
+```bash
wt remove feature-branch
```
Remove worktree but keep branch:
-```console
+```bash
wt remove --no-delete-branch feature-branch
```
Remove multiple worktrees:
-```console
+```bash
wt remove old-feature another-branch
```
Remove in foreground (blocking):
-```console
+```bash
wt remove --no-background feature-branch
```
Switch to default in main:
-```console
+```bash
wt remove # (when already in main worktree)
```
@@ -419,7 +419,7 @@ wt remove # (when already in main worktree)
<!-- ⚠️ AUTO-GENERATED from `wt list --help-md` — edit source to update -->
-```text
+```
wt list — List worktrees and optionally branches
Usage: wt list [OPTIONS]
wt list <COMMAND>
@@ -534,7 +534,7 @@ Note: `locked` and `prunable` are top-level fields on worktree objects, not in s
**Query examples:**
-```console
+```bash
# Find worktrees with conflicts
jq '.[] | select(.status.branch_state == "Conflicts")'
@@ -562,7 +562,7 @@ jq '.[] | select(.is_current == true)'
<!-- ⚠️ AUTO-GENERATED from `wt config --help-md` — edit source to update -->
-```text
+```
wt config — Manage configuration and shell integration
Usage: wt config [OPTIONS] <COMMAND>
@@ -594,19 +594,19 @@ Global Options:
1. Set up shell integration
- ```console
+ ```bash
wt config shell install
```
Or manually add to the shell config:
- ```console
+ ```bash
eval "$(wt config shell init bash)"
```
2. (Optional) Create user config file
- ```console
+ ```bash
wt config create
```
@@ -627,7 +627,7 @@ Global Options:
For Claude:
-```console
+```bash
llm install llm-anthropic
llm keys set anthropic
llm models default claude-haiku-4-5-20251001
@@ -635,7 +635,7 @@ llm models default claude-haiku-4-5-20251001
For OpenAI:
-```console
+```bash
llm keys set openai
```
@@ -662,7 +662,7 @@ Docs: <https://llm.datasette.io/> | <https://github.com/sigoden/aichat>
<!-- ⚠️ AUTO-GENERATED from `wt step --help-md` — edit source to update -->
-```text
+```
wt step — Workflow building blocks
Usage: wt step [OPTIONS] <COMMAND>
diff --git a/docs/sass/custom.scss b/docs/sass/custom.scss
index 960401c42..de17fa2b4 100644
--- a/docs/sass/custom.scss
+++ b/docs/sass/custom.scss
@@ -45,8 +45,8 @@ h2 {
font-size: 1.4rem;
font-weight: 600;
letter-spacing: -0.02em;
- margin-top: 2.75rem;
- margin-bottom: 0.75rem;
+ margin-top: 2rem;
+ margin-bottom: 0.5rem;
position: relative;
display: inline-block;
@@ -67,8 +67,8 @@ h2 {
h3 {
font-size: 1.15rem;
font-weight: 550;
- margin-top: 2rem;
- margin-bottom: 0.6rem;
+ margin-top: 1.5rem;
+ margin-bottom: 0.4rem;
color: var(--wt-color-text-muted);
}
@@ -141,6 +141,14 @@ main {
margin-bottom: 1rem;
}
+// Tighten spacing between paragraphs and code blocks
+.content p + pre,
+.content p + .terminal,
+.content pre + p,
+.content .terminal + p {
+ margin-top: 0.5rem;
+}
+
// Links
.content a {
color: var(--wt-color-link);
@@ -176,7 +184,7 @@ main {
border-radius: 0.5rem;
padding: 0.75rem 1rem;
overflow-x: auto;
- margin: 1.5rem 0;
+ margin: 1rem 0;
code {
background-color: transparent;
@@ -195,7 +203,7 @@ main {
border-radius: 0.5rem;
padding: 0.75rem 1rem;
overflow-x: auto;
- margin: 1.5rem 0;
+ margin: 1rem 0;
font-family: var(--wt-font-mono);
font-size: 0.875rem;
line-height: 1.5;
@@ -222,7 +230,7 @@ main {
border-left: 3px solid var(--wt-color-accent);
position: relative;
background: var(--wt-color-bg-elevated);
- margin: 1.5rem 0;
+ margin: 1rem 0;
p {
margin: 0;
@@ -236,7 +244,7 @@ main {
table {
border-collapse: collapse;
width: 100%;
- margin: 1.5rem 0;
+ margin: 1rem 0;
border-radius: 0.5rem;
overflow: hidden;
border: 1px solid var(--wt-color-border-subtle);
diff --git a/src/main.rs b/src/main.rs
index 2c3d1d5e7..d87ec45fc 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -77,8 +77,15 @@ fn maybe_handle_help_with_pager() -> bool {
ErrorKind::DisplayHelp | ErrorKind::DisplayHelpOnMissingArgumentOrSubcommand
)
{
- // err.render() returns the help text clap already built
- println!("{}", err.render());
+ // Transform code block languages for Zola compatibility:
+ // - ```text (clap's default for usage) -> ``` (no highlighting)
+ // - ```console (our examples) -> ```bash
+ let output = err
+ .render()
+ .to_string()
+ .replace("```text\n", "```\n")
+ .replace("```console\n", "```bash\n");
+ println!("{output}");
process::exit(0);
}
// Fall through if not a help request
diff --git a/tests/integration_tests/readme_sync.rs b/tests/integration_tests/readme_sync.rs
index fbed7b44f..ae9a02f9f 100644
--- a/tests/integration_tests/readme_sync.rs
+++ b/tests/integration_tests/readme_sync.rs
@@ -406,10 +406,10 @@ fn get_help_output(command: &str, project_root: &Path) -> Result<String, String>
let docs = docs.trim_start_matches('\n');
// Increase heading levels so docs headings become children of command heading
let docs = increase_heading_levels(docs);
- format!("```text\n{}{}\n```\n\n{}", first_line, synopsis, docs)
+ format!("```\n{}{}\n```\n\n{}", first_line, synopsis, docs)
} else {
// No documentation section, wrap everything in code block
- format!("```text\n{}{}\n```", first_line, rest)
+ format!("```\n{}{}\n```", first_line, rest)
}
} else {
// Single line output