dotfiles

configurations and scripts
git clone https://riazj.com/git/dotfiles
Log | Files | Refs | README | LICENSE

text2html (331B)


      1 #!/bin/sh -e
      2 
      3 SNIPPETS="$HOME/.local/share/snippets"
      4 title="$(head -1 "$1")"; title="${title#??}"
      5 description="$(sed '2q;d' "$1")"; sed -i '2d' "$1"
      6 
      7 smu "$1" > "$1.tmp"
      8 cat "$SNIPPETS/1.html" "$1.tmp" "$SNIPPETS/2.html" > "$1"
      9 rm "$1.tmp"
     10 sed -i -e "5s/++/$title/" -e "8s|\"\"|\"$description\"|" -e "/<h1>/a\<hr>\n<article>" "$1"