Skip to content

[Feature] Add optional transition text between mdsh invocation and output#100

Open
mwittie wants to merge 2 commits intozimbatm:mainfrom
mwittie:feature/transition-text
Open

[Feature] Add optional transition text between mdsh invocation and output#100
mwittie wants to merge 2 commits intozimbatm:mainfrom
mwittie:feature/transition-text

Conversation

@mwittie
Copy link

@mwittie mwittie commented Feb 12, 2026

To provide a more natural reading flow in the rendered markdown, I'd like mdsh to allow me to specify transition text placed between the invocation and the output. For example:

```sh > sh $ :: which outputs:
echo 'hello world'
```

<!-- BEGIN mdsh -->
which outputs:

```sh
hello world
```
<!-- END mdsh --

A transition text specification ":: text" does not render in the mdsh invocation, but shows up at the top of the rendered mdsh output. Placing the transition text after <!-- BEGIN mdsh --> makes the operation idempotent. Consult the updated spec and readme files for more transition text placement options.

Move transition text (e.g. `:: which outputs:`) from a separate
`<!-- :: text -->` comment line into the mdsh invocation itself,
supported across all invocation types: code blocks, inline code,
comments, and links. The old comment-based syntax is kept as a
fallback for backward compatibility.

(cherry picked from commit 90e7d21)
* Reorganize transition tests under existing execute sections

* Add instructions for transition text in the mdsh invocation and in a comment following the invocation

(cherry picked from commit 8fc1434)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant