[lxc-devel] Putting man pages on website?

Trent W. Buck twb at cybersource.com.au
Thu Feb 17 05:23:05 UTC 2011

Rob Landley <rlandley at parallels.com> writes:

> #!/bin/bash
> for i in lxc-*.in
> do
>   echo $i
>   OUT=$(echo $i | sed 's/\.in$//')
>   HTML=$(echo $i | sed 's/\.sgml\.in$/.html/')
>   echo "<?xml version='1.0' encoding='UTF-8'?>" > $OUT
>   echo '<?xml-stylesheet type="text/xsl" href="http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl"?>' >> $OUT
> sed -e 's@<!DOCTYPE refentry PUBLIC .*@<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [@' \
>     -e 'sX at builddir@/XX' $i >> $OUT

Personally I would prefer to see these changes just patched permanently
in git (and rename s/.sgml/.xml/), so that the Makefile can simply be
something like

html: $(patsubst %.xml,%.html,$(wildcard lxc-*.xml))
	xsltproc http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl $< >$@

...then Rob (or anyone else) can simply do "make -C doc html" or so in
their favourite git checkout.

PS: instead of HTML=$(echo $i | sed 's/\.sgml\.in$/.html/') try
HTML="${i%.sgml.in}.html".  See PATTERN SUBSTITUTIONS in the bash
manpage, though this is POSIX portable sh.

More information about the lxc-devel mailing list