shithub: epublish

ref: 47a22cd6b3d3263203f0ab84b63b8b1450daeaf1
dir: /mkfile.tool/

View raw version
bindir=`{ if (~ $#bindir 1) echo $bindir; if not echo /rc/bin/epublish }

ebook:V: $ebook
	echo built $ebook

ms:V: $ms
	echo built $ms

$ebook:V: $textsource $ebooksource
	rfork
	ramfs
	for (f in $textsource/*){
		fname=`{basename $f | sed 's/\.[a-zA-Z0-9]*$//g'}
		$bindir/txt2ebook $EBOOKARGS <$f >/tmp/$fname.xhtml
	}
	bind -a $ebooksource /tmp
	@{cd /tmp && zip .} >$target

$ms:V: $textsource $mssource
	rfork
	ramfs
	for (f in $textsource/*){
		fname=`{basename $f}
		$bindir/txt2ms $MSARGS <$f >/tmp/$fname.ms
	}
	bind -a $mssource /tmp
	cat /tmp/* >$target