### st.sh # utilities echo()(printf '%s\n' "$*") handle_input() { # handle_input "$@" # handle input --- args or stdin test -n "$1" && printf '%s' "$*" if read -r first_line then echo "$first_line"; cat else echo fi } # authoring commands nb() { # comment mechanism : } # html attr(){ # attr [NAME|VALUE] ATTR_STRING case "$1" in (name) echo "${2%%=*}" ;; (value) echo "${2#*=}" ;; esac } html_el(){ # el TAG [ATTRS...] [TEXT...] [< INPUT] tag="$1"; attrs= ; text= shift for arg do case "$arg" in (*=*) attrs="$attrs ${arg%%=*}=${arg#*=}"; shift ;; (*) break ;; esac done printf '<%s%s>%s' "$tag" "$attrs" handle_input "$@" | sed '$s,$,,' } alias p='html_el p' alias a='html_el a' alias h1='html_el h1' alias blockquote='html_el blockquote' alias bq=blockquote