News for hackers. Stuff that matters.
Re:Show HN: SHML (shell markup language) by joepvd on Friday November 06, 2015 @02:34AM (#10518244)
Nice! I am using some of the funny characters!

Some remarks:

I doubt if it is needed to launch a sub-process for each markup directive. This is fine for small output, but will slow down processing of larger chunks of text. I would be interested in a bash solution based on associative arrays.

As an example, one might want to look at the zsh implementation of the colors script in the main distribution[0], which makes colors available as an associative array:

    # Set once in shell init script:
    autoload -U colors && colors
    # And use it anywhere:
    print $fg[blue]hello colorful world!$fg[reset]
[0]: http://sourceforge.net/p/zsh/code/ci/master/tree/Functions/M...

There are no comments on this comment yet.