wm: infra

ref: 40b40dac456b77f4b46b2e465931f821c564e26e
dir: /doc/html/

View raw version
#!/bin/rc -e

. /sys/lib/shithub/common.rc

cd $1
shift

rfork ne
nl='
'

gituser=$1
repo=$2
refname=$3
file=$4

repons $gituser $repo
if(! ref=`{resolveref $refname}){
	echo '<b>invalid ref '$refname'</b>'
	exit
}

if(! test -d $gitfs/$ref/tree){
	echo '	<p>No code pushed</p>
		</body>
		</html>
	'
	exit
}

cd $gitfs/$ref/tree

echo '	<p>'

echo '<p><div id="content">'

if(test -r $gitfs/$ref/tree/$file.wms)
	wm/doc/wiki2ms $gitfs/$ref/tree/$file.wms | ms2html
if not
	ms2html < $gitfs/$ref/tree/$file.ms
	
echo '	</div>
	</p>
	</body>
	</html>'