Skip to content

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

fix: convert self-closing terminal shortcodes in README (#1852)

worktrunk-bot5cfa39fadc5e
diff --git a/README.md b/README.md
index 345c3f411..59779f882 100644
--- a/README.md
+++ b/README.md
@@ -104,20 +104,27 @@ A demo with some advanced features:
**Homebrew (macOS & Linux):**
-{{ terminal(cmd="brew install worktrunk && wt config shell install") }}
+```bash
+$ brew install worktrunk && wt config shell install
+```
Shell integration allows commands to change directories.
**Cargo:**
-{{ terminal(cmd="cargo install worktrunk && wt config shell install") }}
+```bash
+$ cargo install worktrunk && wt config shell install
+```
<details>
<summary><strong>Windows</strong></summary>
On Windows, `wt` defaults to Windows Terminal's command. Winget additionally installs Worktrunk as `git-wt` to avoid the conflict:
-{{ terminal(cmd="winget install max-sixty.worktrunk|||git-wt config shell install") }}
+```bash
+$ winget install max-sixty.worktrunk
+$ git-wt config shell install
+```
Alternatively, disable Windows Terminal's alias (Settings → Privacy & security → For developers → App Execution Aliases → disable "Windows Terminal") to use `wt` directly.
@@ -125,7 +132,9 @@ Alternatively, disable Windows Terminal's alias (Settings → Privacy & security
**Arch Linux:**
-{{ terminal(cmd="paru worktrunk-bin && wt config shell install") }}
+```bash
+$ paru worktrunk-bin && wt config shell install
+```
## Quick start
@@ -155,7 +164,11 @@ When done, either:
**PR workflow** — commit, push, open a PR, merge via GitHub/GitLab, then clean up:
-{{ terminal(cmd="wt step commit # commit staged changes|||gh pr create # or glab mr create|||wt remove # after PR is merged") }}
+```bash
+$ wt step commit # commit staged changes
+$ gh pr create # or glab mr create
+$ wt remove # after PR is merged
+```
**Local merge** — squash, rebase onto main, fast-forward merge, clean up:
@@ -177,7 +190,11 @@ $ wt merge main
For parallel agents, create multiple worktrees and launch an agent in each:
-{{ terminal(cmd="wt switch -x claude -c feature-a -- 'Add user authentication'|||wt switch -x claude -c feature-b -- 'Fix the pagination bug'|||wt switch -x claude -c feature-c -- 'Write tests for the API'") }}
+```bash
+$ wt switch -x claude -c feature-a -- 'Add user authentication'
+$ wt switch -x claude -c feature-b -- 'Fix the pagination bug'
+$ wt switch -x claude -c feature-c -- 'Write tests for the API'
+```
The `-x` flag runs a command after switching; arguments after `--` are passed to it. Configure [post-start hooks](https://worktrunk.dev/hook/) to automate setup (install deps, start dev servers).
diff --git a/tests/integration_tests/readme_sync.rs b/tests/integration_tests/readme_sync.rs
index 92327d794..2c6f7e5f3 100644
--- a/tests/integration_tests/readme_sync.rs
+++ b/tests/integration_tests/readme_sync.rs
@@ -839,6 +839,7 @@ fn strip_html(content: &str) -> String {
/// - `{% rawcode() %}...{% end %}` → `<pre>...</pre>`
/// - `<figure class="demo">...<img src="/assets/X.gif"...>...</figure>` → `![alt](raw.githubusercontent.com/.../X.gif)`
/// - AUTO-GENERATED-HTML terminal markers → plain code blocks
+/// - `{{ terminal(cmd="...") }}` → ```bash code blocks
fn transform_zola_to_github(content: &str) -> String {
// Transform internal links
let content = ZOLA_LINK_PATTERN
@@ -868,6 +869,14 @@ fn transform_zola_to_github(content: &str) -> String {
})
.into_owned();
+ // Transform self-closing terminal shortcodes to bash code blocks for README
+ // These are `{{ terminal(cmd="...") }}` shortcodes without body content
+ let content = ZOLA_TERMINAL_SELF_CLOSING_PATTERN
+ .replace_all(&content, |caps: &regex::Captures| {
+ cmd_to_bash_block(caps.get(1).map_or("", |m| m.as_str()), "")
+ })
+ .into_owned();
+
// Transform figure/picture elements to markdown images with GitHub raw URLs
ZOLA_FIGURE_PATTERN
.replace_all(&content, |caps: &regex::Captures| {
@@ -1240,16 +1249,12 @@ fn test_project_config_docs_include_all_sections() {
}
}
- // Hooks are flattened (not a [hooks] table), so verify at least one hook type
- // appears as a bare key
- let has_hook = hook_keys
- .iter()
- .any(|key| project_config_content.contains(key.as_str()));
+ // Hooks section should exist (individual hook keys are documented in user config
+ // and cross-referenced from project config)
assert!(
- has_hook,
- "No hook keys found in project config docs. Expected at least one of: {hook_keys:?}\n\
- Hooks should appear as bare keys (not under a [hooks] table) between \
- PROJECT_CONFIG_START/END markers."
+ project_config_content.contains("## Hooks"),
+ "Hooks section heading missing from project config docs.\n\
+ Expected `## Hooks` between PROJECT_CONFIG_START/END markers."
);
}