Plan 9 from Bell Labs’s /usr/web/sources/contrib/steve/root/sys/lib/texmf/doc/mkhtml

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#!/bin/sh

CTAN=ftp://ftp.dante.de/tex-archive/

echo '<TITLE>The TeX System</TITLE>'
echo '<H1>The TeX System</H1>'

for i in *; do
	if [ $i = help ]; then
		echo "<h2>$i</h2><P>"
		echo '<ul>'
		for j in help/*; do
			if [ -f $j/index.html ]; then
				echo "<li><a href=\"$j/index.html\">`basename $j`</a>"
			else
				echo "<li><a href=\"$j\">`basename $j`</a>"
			fi
		done
		echo '</ul>'
		continue
	fi
	if [ -d $i ]; then
		echo "<h2>$i</h2><P>"
		echo '<ul>'
		for j in $i/*.html $i/*.html.gz $i/*.dvi $i/*.ps $i/*.tex $i/*.dvi.gz $i/*.ps.gz $i/*.tex.gz; do
			test -f $j && echo "<li><a href=\"$j\">`basename $j`</a>"
		done
		for j in $i/*; do
			test -d $j || continue
			test -f `echo $j/*.html | sed 's/ .*//'` ||
			test -f `echo $j/*.html.gz | sed 's/ .*//'` ||
			test -f `echo $j/*.ps.gz | sed 's/ .*//'` ||
			test -f `echo $j/*.dvi.gz | sed 's/ .*//'` ||
			test -f `echo $j/*.dvi | sed 's/ .*//'` ||
			test -f `echo $j/*.ps | sed 's/ .*//'` || continue
			if test -f $j/index.html; then
			  echo "<li><a href=\"$j/index.html\">`basename $j`</a>"
			else
			  echo '<li>'`basename $j`
			  echo '<ul>'
			  for k in $j/xyguide-html $j/index.html $j/index.html.gz $j/*.dvi $j/*.ps $j/*.tex $j/*.dvi.gz $j/*.ps.gz $j/*.tex.gz; do
				if test -f $k/index.html; then
				echo "<li><a href=\"$k/index.html\">`basename $k`</a>"
				else
					test -f $k || continue
					echo "<li><a href=\"$k\">`basename $k`</a>"
				fi
			  done
			  echo '</ul>'
			fi
		done
		echo '</ul>'
	fi
done

if test -w help/Catalogue/catalogue.html && grep '\.\./\.\./' help/Catalogue/catalogue.html >/dev/null 2>&1; then
  echo "Changing CTAN location from local to $CTAN in catalogue.html..." >&2
  sed 's@\.\./\.\./@'"$CTAN"@g help/Catalogue/catalogue.html > .tmp$$ || rm -f .tmp$$
  test -f .tmp$$ && cat .tmp$$ > help/Catalogue/catalogue.html
  rm -f .tmp$$
fi

if test -w help/Catalogue/catalogue.html && grep 'http://www.ausflag.com.au/ausflag/images/' help/Catalogue/catalogue.html >/dev/null 2>&1; then
  echo "Changing location for 93-2.gif and 95-3.gif from www.ausflag.com.au to local in catalogue.html..." >&2
  sed 's@http://www.ausflag.com.au/ausflag/images/@@g' help/Catalogue/catalogue.html > .tmp$$ || rm -f .tmp$$
  test -f .tmp$$ && cat .tmp$$ > help/Catalogue/catalogue.html
  rm -f .tmp$$
fi

exit 0

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.