ref: cb9235713472745f68d43c1269a076959fed23a9
dir: /mkfile/
PATHS=`{ls *.ht | sed -e 's/\.ht$//g' | grep -v 'index' | grep -v 'changeblog/';ls changeblog/*.ms | sed -e 's/\.ms$//g'} BLOG=`{ls -r changeblog/*.ms | sed -e 's/\.ms$/.ht/g'} OBJECTS=`{echo 'pub/'^$PATHS^'/index.html'} DOMAIN='https://sirjofri.de/' nl=' ' build:QV: changeblog.ht $OBJECTS pub/index.html pub/changeblog.xml pub/changeblog.plain.xml pub/changeblog/changeblog.pdf pub/files/head.html pub/files/foot.html echo 'Build complete' prepare:QV: changeblog.ht echo 'Prepare complete' mk build pub/changeblog/changeblog.pdf:Q: `{ls -r changeblog/*.ms} { echo '.TL sirjofri.de changeblog' for(i in $prereq){ echo '.PP .PP .B' echo `"{date -m `{basename $i | sed 's:\.ms$::g' | tr -d $nl}}^: echo .R cat $i } } | troff -ms | lp -dstdout | ps2pdf > $target echo '√ '^$target^' created' pub/changeblog.xml:Q: `{ls -r changeblog/*.ms} { echo '<?xml version="1.0" encoding="utf-8"?> <feed xmlns="http://www.w3.org/2005/Atom"> <author> <name>sirjofri</name> <email>sirjofri@sirjofri.de</email> </author> <link rel="self" href="'^$DOMAIN^'changeblog.xml"/> <rights>© Copyright 2020 sirjofri</rights> <id>'^$"DOMAIN^'</id> <title>changeblog</title> <updated>'^`"{date -t | tr -d $nl}^'</updated>' for(i in $prereq){ ifs='' title=`{deroff $i | sed '1,2d;3q' | tr -d $nl} content=`{htmlroff -ms $i | cat} link=$DOMAIN^`{echo -n $i | sed 's:\.ms$:/:' | tr -d $nl} updated=`{date -t `{basename $i | sed 's/\.ms$//'} | tr -d $nl} ifs=' '^$nl echo '<entry> <title>'^$"title^'</title> <id>'^$"link^'</id> <link href="'^$"link^'"/> <updated>'^$"updated^'</updated> <content type="html"><![CDATA['^$"content^']]></content> </entry> ' } echo '</feed>' } > $target echo '√ '^$target^' created' pub/changeblog.plain.xml:Q: `{ls -r changeblog/*.ms} { echo '<?xml version="1.0" encoding="utf-8"?> <feed xmlns="http://www.w3.org/2005/Atom"> <author> <name>sirjofri</name> <email>sirjofri@sirjofri.de</email> </author> <link rel="self" href="'^$DOMAIN^'changeblog.plain.xml"/> <rights>© Copyright 2020 sirjofri</rights> <id>'^$"DOMAIN^'</id> <title>changeblog</title> <updated>'^`"{date -t | tr -d $nl}^'</updated>' for(i in $prereq){ ifs='' title=`{deroff $i | sed '1,2d;3q' | tr -d $nl} content=`{troff -a -ms $i | sed 's/&/\&/g;s/</\</g;s/>/\>/g' | sed 's/$/ /g'} link=$DOMAIN^`{echo -n $i | sed 's:\.ms$:/:' | tr -d $nl} updated=`{date -t `{basename $i | sed 's/\.ms$//'} | tr -d $nl} ifs=' '^$nl echo '<entry> <title>'^$"title^'</title> <id>'^$"link^'</id> <link href="'^$"link^'"/> <updated>'^$"updated^'</updated> <content type="text">'^$"content^'</content> </entry> ' } echo '</feed>' } > $target echo '√ '^$target^' created' changeblog/%.ht:Q: changeblog/%.ms { title=`{ sed -n '/\.HTML/s/\.HTML //p' changeblog/$stem.ms | tr -d $nl } echo '<article> <header> <h2>'^$"title^'</h2> <b>'^`"{date -m $stem | tr -d $nl}^'</b> </header>' htmlroff -ms changeblog/$stem.ms echo '</article>' } > $target echo '√ '^$target^' prepared' changeblog.ht:QV: $BLOG echo '<section> <header> <h2>all articles</h2> </header> <a href="changeblog.pdf">Download pdf</a><br> <a href="/changeblog.xml">Feed</a><br> <ul>' > $target obs=`{ls -r changeblog/*.ms | sed -e 's/\.ms$//g' -e 's:changeblog/::g'} for(OB in $obs){ OBN=`{sed -n '/^\.HTML /s:\.HTML::p' changeblog/^$OB^.ms | tr -d $nl} echo '<li><a href="/changeblog/'^$OB^'/">'^`"{date -m $OB | tr -d $nl}^': '^$"OBN^'</a></li>' >> $target } echo '</ul> </section>' >> $target echo '√ '^$target^' prepared' pub/index.html:QV: head.htf index.ht foot.htf if(! test -d pub) mkdir pub cat $prereq | sed -e 's:PAGETITLE:sirjofri:g' > pub/index.html echo '√ '^$target pub/%/index.html:QV: head.htf %.ht foot.htf dirpart=`{basename -d $target} if(! test -d $dirpart) mkdir -p $dirpart cat $prereq | sed -e 's:PAGETITLE:'^$stem^':g' > pub/$stem/index.html echo '√ '^$target pub/files/%.html:QV: %.htf sed -e 's:PAGETITLE:files:g' $prereq > $target echo '√ '^$target