Skip to content

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

Remove blank lines after demo placeholders in help text

Maximilian Roosaaf263579cad
diff --git a/src/cli.rs b/src/cli.rs
index 40670330a..b4c074b85 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -1846,7 +1846,6 @@ env = "cp {{ repo_root }}/.env.local .env"
#[cfg(unix)]
#[command(
after_long_help = r#"Interactive worktree picker with live preview. Navigate worktrees with keyboard shortcuts and press Enter to switch.
-
<!-- demo: wt-select.gif 1600x800 -->
## Examples
@@ -1890,7 +1889,6 @@ Branches without worktrees are included — selecting one creates a worktree. (`
/// List worktrees and optionally branches
#[command(
after_long_help = r#"Show all worktrees with their status. The table includes uncommitted changes, divergence from the default branch and remote, and optional CI status.
-
<!-- demo: wt-list.gif 1600x900 -->
The table renders progressively: branch names, paths, and commit hashes appear immediately, then status, divergence, and other columns fill in as background git operations complete. With `--full`, CI status fetches from the network — the table displays instantly and CI fills in as results arrive.
@@ -2151,7 +2149,6 @@ Missing a field that would be generally useful? Open an issue at https://github.
/// Switch to a worktree
#[command(
after_long_help = r#"Change directory to a worktree, creating one if needed. Creating a worktree runs [hooks](@/hook.md).
-
<!-- demo: wt-switch.gif 1600x900 -->
Worktrees are addressed by branch name — each worktree has exactly one branch, and the path is derived automatically.
@@ -2366,7 +2363,6 @@ Removal runs in the background by default (returns immediately). Logs are writte
/// Squashes commits, rebases, runs hooks, merges to target, and removes the worktree.
#[command(
after_long_help = r#"Run from a feature worktree to merge into the default branch — like clicking "Merge pull request" on GitHub.
-
<!-- demo: wt-merge.gif 1600x900 -->
## Examples
diff --git a/src/main.rs b/src/main.rs
index edd23576d..bfc45f562 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -548,6 +548,9 @@ fn format_subcommand_section(
/// The HTML comment is invisible in terminal --help output, but expands to a styled figure
/// for web docs generated via --help-page.
///
+/// The placeholder should be on its own line without surrounding blank lines in the source.
+/// This function adds blank lines around the figure for proper markdown paragraph separation.
+///
/// Supports optional dimensions: `<!-- demo: filename.gif 1600x900 -->`
fn expand_demo_placeholders(text: &str) -> String {
const PREFIX: &str = "<!-- demo: ";
@@ -575,8 +578,9 @@ fn expand_demo_placeholders(text: &str) -> String {
// Use figure.demo class for proper mobile styling (no shrink, horizontal scroll)
// Generate <picture> element for light/dark theme switching
// Assets are organized as: /assets/docs/{light,dark}/filename.gif
+ // Add blank line before the figure; blank line after is already in source
let replacement = format!(
- "<figure class=\"demo\">\n<picture>\n <source srcset=\"/assets/docs/dark/{filename}\" media=\"(prefers-color-scheme: dark)\">\n <img src=\"/assets/docs/light/{filename}\" alt=\"{alt_text} demo\"{dim_attrs}>\n</picture>\n</figure>"
+ "\n<figure class=\"demo\">\n<picture>\n <source srcset=\"/assets/docs/dark/{filename}\" media=\"(prefers-color-scheme: dark)\">\n <img src=\"/assets/docs/light/{filename}\" alt=\"{alt_text} demo\"{dim_attrs}>\n</picture>\n</figure>"
);
let end = after_prefix + end_offset + SUFFIX.len();
result.replace_range(start..end, &replacement);
diff --git a/tests/snapshots/integration__integration_tests__help__help_list_long.snap b/tests/snapshots/integration__integration_tests__help__help_list_long.snap
index 8a9ccbb78..55c1ac345 100644
--- a/tests/snapshots/integration__integration_tests__help__help_list_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_list_long.snap
@@ -61,7 +61,6 @@ Usage: wt list [OPTIONS]
Show all worktrees with their status. The table includes uncommitted changes, divergence from the default branch and remote, and optional CI status.
-
The table renders progressively: branch names, paths, and commit hashes appear immediately, then status, divergence, and other columns fill in as
background git operations complete. With --full, CI status fetches from the network — the table displays instantly and CI fills in as results
arrive.
diff --git a/tests/snapshots/integration__integration_tests__help__help_list_narrow_80.snap b/tests/snapshots/integration__integration_tests__help__help_list_narrow_80.snap
index 26f20a058..98e890a6c 100644
--- a/tests/snapshots/integration__integration_tests__help__help_list_narrow_80.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_list_narrow_80.snap
@@ -63,7 +63,6 @@ Usage: wt list [OPTIONS]
Show all worktrees with their status. The table includes uncommitted changes,
divergence from the default branch and remote, and optional CI status.
-
The table renders progressively: branch names, paths, and commit hashes appear
immediately, then status, divergence, and other columns fill in as background
git operations complete. With --full, CI status fetches from the network — the
diff --git a/tests/snapshots/integration__integration_tests__help__help_md_merge.snap b/tests/snapshots/integration__integration_tests__help__help_md_merge.snap
index d667fee00..3497e7475 100644
--- a/tests/snapshots/integration__integration_tests__help__help_md_merge.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_md_merge.snap
@@ -69,7 +69,6 @@ Global Options:
Show commands and debug info
Run from a feature worktree to merge into the default branch — like clicking "Merge pull request" on GitHub.
-
<!-- demo: wt-merge.gif 1600x900 -->
## Examples
diff --git a/tests/snapshots/integration__integration_tests__help__help_merge_long.snap b/tests/snapshots/integration__integration_tests__help__help_merge_long.snap
index ef6b9fe76..119fa2221 100644
--- a/tests/snapshots/integration__integration_tests__help__help_merge_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_merge_long.snap
@@ -72,7 +72,6 @@ Usage: wt merge [OPTIONS] [TARGET]
Run from a feature worktree to merge into the default branch — like clicking "Merge pull request" on GitHub.
-
Examples
Merge to the default branch:
diff --git a/tests/snapshots/integration__integration_tests__help__help_switch_long.snap b/tests/snapshots/integration__integration_tests__help__help_switch_long.snap
index 397f3d125..06bd2fa9a 100644
--- a/tests/snapshots/integration__integration_tests__help__help_switch_long.snap
+++ b/tests/snapshots/integration__integration_tests__help__help_switch_long.snap
@@ -80,7 +80,6 @@ Usage: wt switch [OPTIONS] <BRANCH> [--
Change directory to a worktree, creating one if needed. Creating a worktree runs hooks.
-
Worktrees are addressed by branch name — each worktree has exactly one branch, and the path is derived automatically.
Examples