bin sh There is no warranty for this software Have nice day worklez gm

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
# There is no warranty for this software. Have a nice day.
# worklez@gmail.com
COLORSCHEME="morning"
# Line numbers. Two variants:
# 1. Vim's internal line numbering (NL="", empty)
# 2. <ol> ordered list (NL=no)
NL="no"
FILE="$1"
PARAMS=
PARAMS="$PARAMS -c \"colorscheme $COLORSCHEME\""
PARAMS="$PARAMS -c \"set ${NL}number\""
PARAMS="$PARAMS -c TOhtml"
PARAMS="$PARAMS -c wq -c q"
PARAMS="$PARAMS $FILE"
eval vim $PARAMS 2>/dev/null >/dev/null
if [ "$NL" = "no" ]
then
echo '<ol>'
SED_LI="s/^/<li>/; s/$/<\/li>/; s/<br>//g"
fi
sed -e "1d; /<html>/,/<body/d; /<\/body>/,/<\/html>/d; $SED_LI" \
$FILE.html
[ "$NL" = "no" ] && echo '</ol>'
rm $FILE.html