~royniang/lib

ref: 7b41e484cd650986491405751846a4780878b74b lib/bin/md -rwxr-xr-x 444 bytes
7b41e484roy niang Some improvement and safety measures. 6 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/rc
ppi=157

if(test -e /bin/netsurf)
	browser=netsurf
if not
	browser='mothra -a'

if(! test -e /bin/markdown){
	echo 'You need discount (see 9front’s extras)'
	exit
}

if(~ $#* 0){
	echo 'Usage: md [file]'
	exit
}
d=$1
f=`{basename $d}
c='<meta charset="utf-8" />' # netsurf needs this
window -r 50 50 800 800 -cd `{pwd} 'ramfs;echo '''$c''' > /tmp/'$f'.html; markdown -f 1.0 '$d' >> /tmp/'$f'.html; '$browser' file:///tmp/'$f'.html'