~royniang/lib

ref: 72acf28f15c71235d7be3859dcab7a197400cc43 lib/bin/md -rwxr-xr-x 420 bytes
72acf28froy niang minor fixes. 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

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 -cd `{pwd} 'ramfs;echo '''$c''' > /tmp/'$f'.html; markdown -f 1.0 '$d' >> /tmp/'$f'.html; '$browser' file:///tmp/'$f'.html'