Subject: Generation of html from man pages.
To: None <tech-userlevel@netbsd.org>
From: Phil Nelson <phil@cs.wwu.edu>
List: tech-userlevel
Date: 09/21/2000 16:55:47
Hi,
I'm starting work on getting the man pages in html form up on
www. I noticed that there was not "make html". Since there
is a -mdoc2html in the tree, I have decided to add a few
targets to the make system. The following patch adds the
targets html, installhtml, cleanhtml. None of them are
called in any other make target.
If there objections, please speak up soon. I'd like to
commit theses soon.
By the way, this will install in a /usr/share/man/html[1-9] tree
similar to the cat[1-9] stuff. It also allows one to overide
the /usr/share/man part by defining HTMLDIR.
Index: bsd.man.mk
===================================================================
RCS file: /cvsroot/sharesrc/share/mk/bsd.man.mk,v
retrieving revision 1.55
diff -r1.55 bsd.man.mk
15c15
< .PHONY: catinstall maninstall catpages manpages catlinks manlinks cleanman
---
> .PHONY: catinstall maninstall catpages manpages catlinks manlinks cleanman html installhtml cleanhtml
21a22
> HTMLDIR?= ${DESTDIR}/usr/share/man
31a33
>
33c35,36
< .cat1 .cat2 .cat3 .cat4 .cat5 .cat6 .cat7 .cat8 .cat9
---
> .cat1 .cat2 .cat3 .cat4 .cat5 .cat6 .cat7 .cat8 .cat9 \
> .html1 .html2 .html3 .html4 .html5 .html6 .html7 .html8 .html9
46a50,61
> .9.html9 .8.html8 .7.html7 .6.html6 .5.html5 .4.html4 .3.html3 .2.html2 .1.html1: \
> ${CATDEPS}
> .if !defined(USETBL)
> @echo "${NROFF} -mdoc2html ${.IMPSRC} > ${.TARGET}"
> @${NROFF} -mdoc2html ${.IMPSRC} > ${.TARGET} || \
> (rm -f ${.TARGET}; false)
> .else
> @echo "${TBL} ${.IMPSRC} | ${NROFF} -mdoc2html > ${.TARGET}"
> @${TBL} ${.IMPSRC} | ${NROFF} -mdoc2html > ${.TARGET} || \
> (rm -f ${.TARGET}; false)
> .endif
>
50a66,68
> .if !defined(NOHTML)
> HTMLPAGES= ${MANPAGES:C/(.*).([1-9])/\1.html\2/}
> .endif
149a168,184
>
> # Html rules
> html: ${HTMLPAGES}
>
> .if defined(HTMLPAGES) && !empty(HTMLPAGES)
> .for P in ${HTMLPAGES}
> ${HTMLDIR}/${P:T:E}/${P:T:R}.html: ${P}
> ${MINSTALL} ${.ALLSRC} ${.TARGET}
> .endfor
> .endif
> installhtml: ${HTMLPAGES:@P@${HTMLDIR}/${P:T:E}/${P:T:R}.html@}
>
> cleanhtml:
> .if defined(HTMLPAGES) && !empty(HTMLPAGES)
> rm -f ${HTMLPAGES}
> .endif
>
Index: bsd.own.mk
===================================================================
RCS file: /cvsroot/sharesrc/share/mk/bsd.own.mk,v
retrieving revision 1.141
diff -r1.141 bsd.own.mk
145c145
< install lint obj regress tags
---
> install lint obj regress tags html installhtml cleanhtml
148c148,149
< beforeinstall afterinstall realinstall realdepend realall
---
> beforeinstall afterinstall realinstall realdepend realall \
> html installhtml cheanhtml
--
Phil Nelson NetBSD: http://www.netbsd.org
e-mail: phil@cs.wwu.edu Coda: http://www.coda.cs.cmu.edu
http://cs.wwu.edu/faculty/nelson