Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Apr 2001 07:55:46 +0100
From:      Nik Clayton <nik@freebsd.org>
To:        Murray Stokely <murray@osd.bsdi.com>
Cc:        Nik Clayton <nik@FreeBSD.ORG>, freebsd-doc@FreeBSD.ORG
Subject:   Re: Indexing the Handbook
Message-ID:  <20010411075546.A6461@canyon.nothing-going-on.org>
In-Reply-To: <20010409015111.B6398@meow.osd.bsdi.com>; from murray@osd.bsdi.com on Mon, Apr 09, 2001 at 01:51:11AM -0700
References:  <20010223144043.A46865@canyon.nothing-going-on.org> <Pine.BSF.4.31.0103282230500.8770-100000@meow.osd.bsdi.com> <20010404103259.C45781@canyon.nothing-going-on.org> <20010409015111.B6398@meow.osd.bsdi.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--H1spWtNR+x+ondvy
Content-Type: multipart/mixed; boundary="y0ulUmNC+osPPQO6"
Content-Disposition: inline


--y0ulUmNC+osPPQO6
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Mon, Apr 09, 2001 at 01:51:11AM -0700, Murray Stokely wrote:
> On Wed, Apr 04, 2001 at 10:32:59AM +0100, Nik Clayton wrote:
> > Looking through doc.docbook.mk, I think there's a bug with GEN_INDEX,
> > and the html and html-split formats (I think there's a possibility for
> > it to use the FORMATS=3Dhtml index.sgml when, in fact,
> > FORMATS=3Dhtml-split.
> >=20
> > I'll try and test that out and fix it if it is a problem.
>=20
>   This is how I fixed the problem on my local tree.  I simply create
> an index.sgml file with 'touch' to solve the chicken and egg problem
> so that jade doesn't bomb out in the first pass, and then I add the -f
> option to collateindex.pl to clobber this blank file.  Did you have a
> more elegant solution, or do you mind if I commit this?

I think you're supposed to use the -N option to collateindex.pl to do
this.

Attached is what's currently in my tree.  It pulls out the generation of
the various .index files to separate targets, and uses a different
=2Eindex file for html, html-split, and print formats.

It's only been lightly tested, and the output for print indexes seems to
be screwy on my test document -- I have no idea why.

Also, I think the 'API' (for want of a better term) for this is wrong.
At the moment, if GEN_INDEX is defined then it is assumed that the index
will be written to index.sgml.

I think this should be changed, so that if GEN_INDEX is defined but
empty then 'index.sgml' is chosen, and that if GEN_INDEX is defined and
non-empty then the index is written to the file named in GEN_INDEX.

In this context, GEN_INDEX might not be the best filename to use.

N
--=20
FreeBSD: The Power to Serve             http://www.freebsd.org/
FreeBSD Documentation Project           http://www.freebsd.org/docproj/

          --- 15B8 3FFC DDB4 34B0 AA5F  94B7 93A8 0764 2C37 E375 ---

--y0ulUmNC+osPPQO6
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=diff
Content-Transfer-Encoding: quoted-printable

Index: mk/doc.docbook.mk
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/doc/share/mk/doc.docbook.mk,v
retrieving revision 1.31
diff -u -r1.31 doc.docbook.mk
--- mk/doc.docbook.mk	2001/03/27 16:15:07	1.31
+++ mk/doc.docbook.mk	2001/04/10 15:17:10
@@ -126,46 +126,96 @@
=20
 .for _curformat in ${FORMATS}
 _cf=3D${_curformat}
+
 .if ${_cf} =3D=3D "html-split"
 _docs+=3D index.html HTML.manifest ln*.html
 CLEANFILES+=3D `[ -f HTML.manifest ] && xargs < HTML.manifest` HTML.manife=
st ln*.html
+.if defined(GEN_INDEX)
+SRCS+=3D index.sgml html-split.index
+CLEANFILES+=3D index.sgml html-split.index
+.endif
+
+
 .elif ${_cf} =3D=3D "html-split.tar"
 _docs+=3D ${DOC}.html-split.tar
 CLEANFILES+=3D `[ -f HTML.manifest ] && xargs < HTML.manifest` HTML.manife=
st ln*.html
 CLEANFILES+=3D ${DOC}.html-split.tar
+.if defined(GEN_INDEX)
+SRCS+=3D index.sgml html-split.index
+CLEANFILES+=3D index.sgml html-split.index
+.endif
+
 .elif ${_cf} =3D=3D "html"
 _docs+=3D ${DOC}.html
 CLEANFILES+=3D ${DOC}.html
+.if defined(GEN_INDEX)
+SRCS+=3D index.sgml html.index
+CLEANFILES+=3D index.sgml html.index
+.endif
+
 .elif ${_cf} =3D=3D "html.tar"
 _docs+=3D ${DOC}.html.tar
 CLEANFILES+=3D ${DOC}.html ${DOC}.html.tar
+.if defined(GEN_INDEX)
+SRCS+=3D index.sgml html.index
+CLEANFILES+=3D index.sgml html.index
+.endif
+
 .elif ${_cf} =3D=3D "txt"
 _docs+=3D ${DOC}.txt
 CLEANFILES+=3D ${DOC}.html ${DOC}.txt ${DOC}.html-text
+.if defined(GEN_INDEX)
+SRCS+=3D index.sgml html.index
+CLEANFILES+=3D index.sgml html.index
+.endif
+
 .elif ${_cf} =3D=3D "dvi"
 _docs+=3D ${DOC}.dvi
 CLEANFILES+=3D ${DOC}.aux ${DOC}.dvi ${DOC}.log ${DOC}.tex
+.if defined(GEN_INDEX)
+SRCS+=3D index.sgml print.index
+CLEANFILES+=3D index.sgml print.index
+.endif
+
 .elif ${_cf} =3D=3D "ps"
 _docs+=3D ${DOC}.ps
 CLEANFILES+=3D ${DOC}.aux ${DOC}.dvi ${DOC}.log ${DOC}.tex-ps ${DOC}.ps
+.if defined(GEN_INDEX)
+SRCS+=3D index.sgml print.index
+CLEANFILES+=3D index.sgml print.index
+.endif
+
 .elif ${_cf} =3D=3D "pdf"
 _docs+=3D ${DOC}.pdf
 CLEANFILES+=3D ${DOC}.aux ${DOC}.dvi ${DOC}.log ${DOC}.out ${DOC}.tex-pdf =
${DOC}.pdf
+.if defined(GEN_INDEX)
+SRCS+=3D index.sgml print.index
+CLEANFILES+=3D index.sgml print.index
+.endif
+
 .elif ${_cf} =3D=3D "rtf"
 _docs+=3D ${DOC}.rtf
 CLEANFILES+=3D ${DOC}.rtf
+.if defined(GEN_INDEX)
+SRCS+=3D index.sgml print.index
+CLEANFILES+=3D index.sgml print.index
+.endif
+
 .elif ${_cf} =3D=3D "tar"
 _docs+=3D ${DOC}.tar
 CLEANFILES+=3D ${DOC}.tar
+
 .elif ${_cf} =3D=3D "pdb"
 _docs+=3D ${DOC}.pdb ${.CURDIR:T}.pdb
 CLEANFILES+=3D ${DOC}.pdb ${.CURDIR:T}.pdb
+.if defined(GEN_INDEX)
+SRCS+=3D index.sgml html.index
+CLEANFILES+=3D index.sgml html.index
 .endif
-.endfor
=20
-.if defined(GEN_INDEX)
-CLEANFILES+=3DHTML.index
 .endif
+.endfor
+
=20
 #
 # Build a list of install-${format}.${compress_format} targets to be
@@ -196,20 +246,12 @@
 all: ${_docs}
=20
 index.html HTML.manifest: ${SRCS} ${LOCAL_IMAGES_LIB} ${IMAGES_PNG}
-.if defined(GEN_INDEX)
-	${JADE} -V html-index -ioutput.html -ioutput.html.images ${JADEOPTS} -d $=
{DSLHTML} -t sgml ${MASTERDOC}
-	perl ${PREFIX}/share/sgml/docbook/dsssl/modular/bin/collateindex.pl -o in=
dex.sgml HTML.index
-.endif
 	${JADE} -V html-manifest -ioutput.html -ioutput.html.images ${JADEOPTS} -=
d ${DSLHTML} -t sgml ${MASTERDOC}
 .if !defined(NO_TIDY)
 	-tidy -i -m -f /dev/null ${TIDYFLAGS} `xargs < HTML.manifest`
 .endif
=20
 ${DOC}.html: ${SRCS} ${LOCAL_IMAGES_LIB} ${IMAGES_PNG}
-.if defined(GEN_INDEX)
-	${JADE} -V html-index -ioutput.html -ioutput.html.images -V nochunks ${JA=
DEOPTS} -d ${DSLHTML} -t sgml ${MASTERDOC}
-	perl ${PREFIX}/share/sgml/docbook/dsssl/modular/bin/collateindex.pl -o in=
dex.sgml HTML.index
-.endif
 	${JADE} -ioutput.html -ioutput.html.images -V nochunks ${JADEOPTS} -d ${D=
SLHTML} -t sgml ${MASTERDOC} > ${.TARGET} || (rm -f ${.TARGET} && false)
 .if !defined(NO_TIDY)
 	-tidy -i -m -f /dev/null ${TIDYFLAGS} ${.TARGET}
@@ -288,6 +330,29 @@
=20
 lint validate:
 	${NSGMLS} -s -c ${FREEBSDCATALOG} -c ${DSSSLCATALOG} -c ${DOCBOOKCATALOG}=
 -c ${JADECATALOG} ${EXTRA_CATALOGS:S/^/-c /g} ${MASTERDOC}
+
+# ------------------------------------------------------------------------
+#
+# Index targets
+#
+
+#
+# Generate a different .index file based on the format name
+#
+
+index.sgml:
+	perl ${PREFIX}/share/sgml/docbook/dsssl/modular/bin/collateindex.pl -N -o=
 index.sgml
+
+html.index:
+	${JADE} -V html-index -ioutput.html -ioutput.html.images -V nochunks ${JA=
DEOPTS} -d ${DSLHTML} -t sgml ${MASTERDOC} > /dev/null
+	perl ${PREFIX}/share/sgml/docbook/dsssl/modular/bin/collateindex.pl -o in=
dex.sgml html.index
+
+html-split.index:
+	${JADE} -V html-index -ioutput.html -ioutput.html.images ${JADEOPTS} -d $=
{DSLHTML} -t sgml ${MASTERDOC} > /dev/null
+	perl ${PREFIX}/share/sgml/docbook/dsssl/modular/bin/collateindex.pl -o in=
dex.sgml html-split.index
+
+print.index: html.index
+	mv html.index print.index
=20
 # ------------------------------------------------------------------------
 #
Index: sgml/freebsd.dsl
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /home/ncvs/doc/share/sgml/freebsd.dsl,v
retrieving revision 1.28
diff -u -r1.28 freebsd.dsl
--- sgml/freebsd.dsl	2001/04/09 20:35:47	1.28
+++ sgml/freebsd.dsl	2001/04/10 15:08:16
@@ -68,6 +68,11 @@
                 (normalize "legalnotice")
                 (normalize "isbn")))
=20
+        (define html-index-filename
+          (if nochunks
+            "html.index"
+            "html-split.index"))
+
         <!-- This is the text to display at the bottom of each page.
              Defaults to nothing.  The individual stylesheets should
              redefine this as necessary. -->
@@ -182,6 +187,9 @@
           (if (string=3D? (gi nd) (normalize "book"))
               3
               1))
+
+        (define html-index-filename
+          "print.index")
 =20
         (define %body-start-indent%=20
           0pi)

--y0ulUmNC+osPPQO6--

--H1spWtNR+x+ondvy
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (FreeBSD)
Comment: For info see http://www.gnupg.org

iEYEARECAAYFAjrT//IACgkQk6gHZCw343UPvACfTER6AIBVObJZHiXVLJEbg9A+
YQMAnRbmmfMdOzc4jmyw3fXm2NRBhvET
=Eyko
-----END PGP SIGNATURE-----

--H1spWtNR+x+ondvy--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-doc" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010411075546.A6461>