Closed sc0ttj closed 5 years ago
At the point of the script where mdshell is about to append $line to $text, it should pass $line through a list of available plugins.
mdshell
Something like
for plugin in plugins/mdshell/*.sh do line="$(echo "$line" | plugin)" done
An example plugin script:
while read line do [ "$(echo "$line" | grep 'foo')" != "" ] && echo '**'"$line"'**' || echo $line done < "${1:-/dev/stdin}"
If a line contained 'foo', it would be made bold.
Should use
while IFS= read -r line
to preserve whitespace and newlines, and backslashes
At the point of the script where
mdshell
is about to append $line to $text, it should pass $line through a list of available plugins.Something like
An example plugin script:
If a line contained 'foo', it would be made bold.