~royniang/lib

80fa137dadc888a12b611ecf8a972475bf6e2b9f — roy niang 8 months ago 36c6a4f
Added a md and pdf viewing script.
2 files changed, 32 insertions(+), 0 deletions(-)

A bin/md
A bin/pdf
A bin/md => bin/md +19 -0
@@ 0,0 1,19 @@
#!/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
window -cd `{pwd} 'ramfs;markdown '$d' > /tmp/'$d'.html; '$browser' file:///tmp/'$d'.html'

A bin/pdf => bin/pdf +13 -0
@@ 0,0 1,13 @@
#!/bin/rc
ppi=157

if(~ $#* 0){
	echo 'Usage: pdf file page'
	exit
}
d=$1
if(~ $#2 1)
	p=$2
	window -cd `{pwd} page -R -p $ppi -j $d!$p $d
if not
	window -cd `{pwd} page -R -p $ppi $d