[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH BOOK] Making multi page html-book

From: Jani Averbach <jaa_at_cc.jyu.fi>
Date: 2003-02-09 06:55:07 CET

Hello!

With this patch it is possible to do multi page html version of book.
There is however one caveat, xlstproc produces enormous amount of pages
when it has been driven by chunk.xls and name for those dir is almoust
unpredictable. So there is need for temp-dir. This patch create that temp
dir during making of book, other solution would be create it permanently
to svn-tree.

The multi page and single page version can live happily and peacefully
in the same install(target) directory. Entry point for multi page
version is index.html.

BR, Jani

P.S. My state of art computer loads single-page svn-book about 25
seconds.

Log:

With this patch it is possible to create multi page html version of
the Subversion Book. The book-html-chunk will create a tmp dir because
otherwise those gazillon html pages will clutter up the current working
dir.

* Makefile: Added book-html-chunk and install-book-html-chunk targets.

Index: Makefile
===================================================================
--- Makefile (revision 4803)
+++ Makefile (working copy)
@@ -6,6 +6,7 @@
 SHELL = /bin/sh

 BOOK_TOP = .
+BOOK_TMPDIR = $(BOOK_TOP)/tmp
 BOOK_DIR = ${BOOK_TOP}/book
 BOOK_HTML_TARGET = $(BOOK_DIR)/book.html
 BOOK_PDF_TARGET = $(BOOK_DIR)/book.pdf
@@ -27,6 +28,7 @@
 XSL_DIR = ${BOOK_TOP}/tools/xsl
 XSL_FO = ${BOOK_TOP}/tools/fo-stylesheet.xsl
 XSL_HTML = $(XSL_DIR)/html/docbook.xsl
+XSL_HTML_CHUNK = $(XSL_DIR)/html/chunk.xsl

 RUN_FOP = ${BOOK_TOP}/tools/bin/run-fop.sh

@@ -34,15 +36,15 @@

 install: install-book install-misc-docs

-all-html: book-html misc-docs-html
+all-html: book-html book-html-chunk misc-docs-html

 all-pdf: book-pdf misc-docs-pdf

 all-ps: book-ps misc-docs-ps

-all-book: book-html book-pdf book-ps
+all-book: book-html book-html-chunk book-pdf book-ps

-install-book: install-book-html install-book-pdf install-book-ps
+install-book: install-book-html install-book-html-chunk install-book-pdf install-book-ps

 all-misc-docs: misc-docs-html misc-docs-pdf book-ps

@@ -57,6 +59,11 @@
 $(BOOK_HTML_TARGET): $(BOOK_ALL_SOURCE)
         $(XSLTPROC) $(XSL_HTML) $(BOOK_XML_SOURCE) > $(BOOK_HTML_TARGET)

+## This trailing slash is essential that xsltproc will output pages to the dir
+book-html-chunk: $(BOOK_ALL_SOURCE)
+ mkdir -p $(BOOK_TMPDIR)
+ $(XSLTPROC) -o $(BOOK_TMPDIR)/ $(XSL_HTML_CHUNK) $(BOOK_XML_SOURCE)
+
 book-pdf: $(BOOK_PDF_TARGET)

 book-ps: $(BOOK_PS_TARGET)
@@ -77,6 +84,12 @@
         $(INSTALL) $(BOOK_HTML_TARGET) $(BOOK_INSTALL_DIR)
         $(INSTALL) $(BOOK_DIR)/images/*.png $(BOOK_INSTALL_DIR)/images

+## index.html is created last
+install-book-html-chunk: $(BOOK_TMPDIR)/index.html
+ $(INSTALL) -d $(BOOK_INSTALL_DIR)/images
+ $(INSTALL) $(BOOK_TMPDIR)/*.html $(BOOK_INSTALL_DIR)
+ $(INSTALL) $(BOOK_DIR)/images/*.png $(BOOK_INSTALL_DIR)/images
+
 install-book-pdf: $(BOOK_PDF_TARGET) $(BOOK_INSTALL_DIR)
         $(INSTALL) $(BOOK_PDF_TARGET) $(BOOK_INSTALL_DIR)

@@ -84,7 +97,7 @@
         $(INSTALL) $(BOOK_PS_TARGET) $(BOOK_INSTALL_DIR)

 book-clean:
- rm -f $(BOOK_HTML_TARGET) $(BOOK_FO_TARGET)
+ rm -f $(BOOK_HTML_TARGET) $(BOOK_FO_TARGET) $(BOOK_TMPDIR)/*.html
         rm -f $(BOOK_PDF_TARGET) $(BOOK_PS_TARGET)

 misc-docs-html: $(MDOCS_HTML_TARGET)

--
Jani Averbach
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Feb 9 06:55:52 2003

This is an archived mail posted to the Subversion Dev mailing list.