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...
Re:Show HN: SHML (shell markup language) by ianbicking on Thursday November 05, 2015 @11:26PM (#10517828)
I'm a little surprised something like "$(fgcolor red hello)" requires a $(fgcolor end) - if you include arguments shouldn't it be self-closing? Then you get nice things like "$(fgcolor red " $(hr)")"

$(title "header") could be cool, outputting " header$(br)------"

An alias for \r could be nice, to go with $(br).

Re:Show HN: SHML (shell markup language) by burke on Friday November 06, 2015 @12:15AM (#10517955)
But if you've done: "$(fgcolor red)red text$(fgcolor green "green text") what color is this?"... then it would have to model a stack on top of the actual underlying implementation, which does not have any concept of "closing" a sequence to pop the colour back to the previous colour. It could automatically emit the \x1b[0m, but it would be making assumptions about nesting.
Re:Show HN: SHML (shell markup language) by josegonzalez on Thursday November 05, 2015 @11:04PM (#10517777)
I really like the idea of this, great work!

Unrelated, I'm pretty sad that there hasn't been further work in packaging shell extensions like this. Most of it is adhoc, and people usually tend to stick to `curl | bash` (I'm guilty of this as well with dokku and other OS projects).

Re:Show HN: SHML (shell markup language) by zhynn on Thursday November 05, 2015 @10:16PM (#10517653)
Well, I like it. Thanks. I shall try using it for the MOTD on the HPC cluster I manage.
Re:Show HN: SHML (shell markup language) by jdorfman on Thursday November 05, 2015 @10:27PM (#10517684)
Thank you. Please reach out if you have any questions or general feedback.
Re:Show HN: SHML (shell markup language) by agumonkey on Friday November 06, 2015 @12:30AM (#10517988)
Making tty formatting very close to dom/css semantics, interesting.
Re:Show HN: SHML (shell markup language) by CrowderSoup on Friday November 06, 2015 @02:55AM (#10518287)
This is awesome, just a shame there isn't anything like this for MS PowerShell.
Re:Show HN: SHML (shell markup language) by Arnavion on Friday November 06, 2015 @03:30AM (#10518377)

   function color ($name) { $Host.UI.RawUI.ForegroundColor = $name }
   function sayhello { 'pardon me do you have any grey poupon?' }
   echo $(color yellow) $(sayhello)
The other stuff (bold, pictures) requires host support (more than regular powershell.exe provides).
Re:Show HN: SHML (shell markup language) by shadowfox on Friday November 06, 2015 @09:00AM (#10519453)
> The other stuff (bold, pictures) requires host support (more than regular powershell.exe provides).

PoshConsole made a nice stab at it. Sadly it is no longer developed, I think.

Simple unicode characters (the smilies etc as used in OP) does work in powershell ISE.

[1] https://poshconsole.codeplex.com/

Re:Show HN: SHML (shell markup language) by cableshaft on Friday November 06, 2015 @11:36AM (#10520326)
At first I got dyslexic and was excited to try the Shaking My Head Language (SMHL).
Re:Show HN: SHML (shell markup language) by ddvinay on Friday November 06, 2015 @12:32AM (#10517992)
I like it! It even works in MobaXTerm. Although two tests failed.