add syntax for using existing snippet as input
As far as I understand mdsh, it is currently used to (re-)generate markdown snippets. It would be nice if a command could update an existing snippet, so we don't have to generate the entire thing in code but rather modify the tiny bit we are interested in.
This could be implemented by injecting the target block as stdin:
`& sed -e 's/foo/bar/'`
```
loooooooooooooooooooooooong snippet foo
```
Run mdsh. `foo` is fed as stdin to sed. Result:
`& sed -e 's/foo/bar/'`
```
loooooooooooooooooooooooong snippet bar
```
This could for example be used to update things like versions in more complex markdown blocks.
关闭于 2025-07-29 2 条评论