# HG changeset patch # User lumag # Date 1066643808 0 # Node ID 6dfed0b2a30017a9d30b96a7190292cbef69e208 # Parent bd4a5a95464465c0be9e80a9de7940c8e9e829ee Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single) diff -r bd4a5a954644 -r 6dfed0b2a300 DOCS/xml/.cvsignore --- a/DOCS/xml/.cvsignore Mon Oct 20 00:58:46 2003 +0000 +++ b/DOCS/xml/.cvsignore Mon Oct 20 09:56:48 2003 +0000 @@ -1,3 +1,4 @@ html.xsl +html-chunk.xsl xsltproc.sh xmllint.sh diff -r bd4a5a954644 -r 6dfed0b2a300 DOCS/xml/Makefile --- a/DOCS/xml/Makefile Mon Oct 20 00:58:46 2003 +0000 +++ b/DOCS/xml/Makefile Mon Oct 20 09:56:48 2003 +0000 @@ -6,39 +6,57 @@ # Generated HTML files go here. HTML_TOP = ../HTML +# Here go unchunked files (all DOCS in single HTML file) +HTML_UNCHUNKED = ../HTML-single .PHONY: all -all: build-html +all: build-html build-html-chunked .PHONY: help help: @echo "Targets:" @echo "********" - @echo "all : Build everything (same as build-html for now)." - @echo "build-html: Build HTML documentation." - @echo "clean-html: Purge the 'HTML' directory." - @echo "distclean : Remove ALL generated files." + @echo "all : Build everything" + @echo " (same as build-html and build-html-chunked for now)." + @echo "build-html : Build HTML documentation (single file)." + @echo "build-html-chunked: Build HTML documentation (multiple files)." + @echo "clean-html : Purge the 'HTML-single' directory." + @echo "clean-html-chunked: Purge the 'HTML' directory." + @echo "distclean : Remove ALL generated files." -.PHONY: build-html -build-html: xsltproc.sh +.PHONY: build-html-chunked +build-html-chunked: xsltproc.sh test -d $(HTML_TOP) || mkdir $(HTML_TOP) for dir in $(SUBDIRS); do\ test -f $$dir/Makefile &&\ (test -d $(HTML_TOP)/$$dir || mkdir $(HTML_TOP)/$$dir) &&\ - if $(MAKE) HTMLDIR=../$(HTML_TOP)/$$dir -C $$dir; then :; else exit 1; fi;\ + if $(MAKE) HTMLDIR=../$(HTML_TOP)/$$dir -C $$dir html-chunked; then :; else exit 1; fi;\ done +.PHONY: build-html +build-html: xsltproc.sh + test -d $(HTML_TOP) || mkdir $(HTML_TOP) + test -d $(HTML_UNCHUNKED) || mkdir $(HTML_UNCHUNKED) + for dir in $(SUBDIRS); do\ + test -f $$dir/Makefile &&\ + if $(MAKE) HTMLFILE=../$(HTML_UNCHUNKED)/mplayer_docs_$$dir.html -C $$dir html; then :; else exit 1; fi;\ + done + +.PHONY: clean-html-chunked +clean-html: + -rm -rf $(HTML_TOP) + .PHONY: clean-html clean-html: - -rm -rf $(HTML_TOP) + -rm -rf $(HTML_UNCHUNKED) .PHONY: distclean -distclean: clean-html +distclean: clean-html clean-html-chunked for dir in $(SUBDIRS); do\ test -f $$dir/Makefile &&\ if $(MAKE) HTMLDIR=../$(HTML_TOP)/$$dir -C $$dir distclean ; then :; else exit 1; fi;\ done - -rm -f html.xsl xsltproc.sh xmllint.sh + -rm -f html.xsl html-chunk.xsl xsltproc.sh xmllint.sh xsltproc.sh: configure ./configure diff -r bd4a5a954644 -r 6dfed0b2a300 DOCS/xml/Makefile.inc --- a/DOCS/xml/Makefile.inc Mon Oct 20 00:58:46 2003 +0000 +++ b/DOCS/xml/Makefile.inc Mon Oct 20 09:56:48 2003 +0000 @@ -2,26 +2,55 @@ # Makefile.inc for Makefiles in subdirectories. # -# Use customized html.xsl file if it exists... +# Use customized html.xsl and/or html-chunk.xsl file if they exist... +# Also add html-common.xsl to depends if it exists. ifeq (html.xsl,$(wildcard html.xsl)) HTML_XSL := html.xsl -XSL_DEPS := $(HTML_XSL) ../html.xsl ../html-common.xsl +ifeq (html-common.xsl,$(wildcard html-common.xsl)) +XSL_DEPS := $(HTML_XSL) html-common.xsl ../html.xsl ../html-common.xsl +else +XSL_DEPS := $(HTML_XSL) html-common.xsl ../html.xsl ../html-common.xsl +endif else HTML_XSL := ../html.xsl XSL_DEPS := $(HTML_XSL) ../html-common.xsl endif +ifeq (html-chunk.xsl,$(wildcard html-chunk.xsl)) +HTML_CHUNK_XSL := html-chunk.xsl +ifeq (html-common.xsl,$(wildcard html-common.xsl)) +CHUNK_XSL_DEPS := $(HTML_CHUNK_XSL) html-common.xsl ../html-chunk.xsl ../html-common.xsl +else +CHUNK_XSL_DEPS := $(HTML_CHUNK_XSL) ../html-chunk.xsl ../html-common.xsl +endif +else +HTML_CHUNK_XSL := ../html-chunk.xsl +CHUNK_XSL_DEPS := $(HTML_CHUNK_XSL) ../html-common.xsl +endif + # Fall back to the default HTML stylesheet if none is specified. HTML_STYLESHEET ?= ../default.css # This is the main target... -$(HTMLDIR)/index.html: documentation.xml $(XSL_DEPS) +all: html html-chunked +html: $(HTMLFILE) +html-chunked: $(HTMLDIR)/index.html + +$(HTMLDIR)/index.html: documentation.xml $(CHUNK_XSL_DEPS) @if test "$(HTMLDIR)" = "" ; then echo "Error: HTMLDIR not set!!!"; echo "Typically this means, that you've run make from subdir of DOCS/xml. Don't do this!" ; false; fi if test "$(USE_SYMLINKS)" = "yes" ; then for file in ../en/*.xml ; do if ! test -r `basename $$file` ; then ln -s $$file `basename $$file` ; fi ; done ; fi -rm -f $(HTMLDIR)/* ../xmllint.sh $< cp $(HTML_STYLESHEET) $(HTMLDIR)/ - ../xsltproc.sh $(HTMLDIR)/ $(HTML_XSL) $< + ../xsltproc.sh $(HTMLDIR)/ $(HTML_CHUNK_XSL) $< + +$(HTMLFILE): documentation.xml $(XSL_DEPS) + @if test "$(HTMLFILE)" = "" ; then echo "Error: HTMLFILE not set!!!"; echo "Typically this means, that you've run make from subdir of DOCS/xml. Don't do this!" ; false; fi + if test "$(USE_SYMLINKS)" = "yes" ; then for file in ../en/*.xml ; do if ! test -r `basename $$file` ; then ln -s $$file `basename $$file` ; fi ; done ; fi + -rm -f $(HTMLFILE) + ../xmllint.sh $< + cp -f $(HTML_STYLESHEET) `dirname $(HTMLFILE)` + ../xsltproc.sh $(HTMLFILE) $(HTML_XSL) $< ../html.xsl: cd .. && sh configure diff -r bd4a5a954644 -r 6dfed0b2a300 DOCS/xml/README.maintainers --- a/DOCS/xml/README.maintainers Mon Oct 20 00:58:46 2003 +0000 +++ b/DOCS/xml/README.maintainers Mon Oct 20 09:56:48 2003 +0000 @@ -28,21 +28,47 @@ 3) Set to your language code if the DocBook XSL stylesheets support it. 4) If you want to use a customized XSL stylesheet, create one and name it - 'html.xsl'. And do not forget to import the toplevel XSL file: + 'html-common.xsl'. Also create two additional XSL stylesheets ('html.xsl' + and 'html-chunk.xsl', with such content: + + html.xsl: + + + + + + - + + + html-chunk.xsl: + + + + + + + + + Note: You mustn't xsl:include or xsl:import chunk.xsl directly! Including it can (and will) break building of documentation if chunk.xsl is installed at a nonstandard location. -5) If you wish to change output encoding of generated files, create html.xsl - as suggested in step 4) and add somwhere after such string: +5) If you wish to change output encoding of generated files, create + html-common.xsl as suggested in step 4) and add such strings somewhere + between and tags + (please, pay attention to quotes): - - Use ru/html.xsl as example. + + + Use ru/html-common.xsl as example. 6) If you are using your own HTML stylesheet, edit your Makefile and set - the HTML_STYLESHEET variable to its name. + the HTML_STYLESHEET variable to its name. Please, don't give name + 'default.css' to your HTML stylesheet. 7) In each translated file after the tag you must put a note like , where 1.2 is the revision of corresponding English file (see comment at the top of file). diff -r bd4a5a954644 -r 6dfed0b2a300 DOCS/xml/configure --- a/DOCS/xml/configure Mon Oct 20 00:58:46 2003 +0000 +++ b/DOCS/xml/configure Mon Oct 20 09:56:48 2003 +0000 @@ -25,7 +25,8 @@ -echo "Searching for stylesheet..." +echo "Searching stylesheets..." +echo "Searching html/chunk.xsl..." for _try_chunk_xsl in /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/html/chunk.xsl /usr/share/sgml/docbook/yelp/docbook/html/chunk.xsl /usr/local/share/sgml/docbook/stylesheet/xsl/nwalsh/html/chunk.xsl /usr/local/share/sgml/docbook/yelp/docbook/html/chunk.xsl /usr/share/docbook-xsl/html/chunk.xsl do if test -f "$_try_chunk_xsl" @@ -44,6 +45,40 @@ echo "Found chunk.xsl at $_chunk_xsl" fi +echo "Searching for html/docbook.xsl..." +for _try_docbook_xsl in /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/html/docbook.xsl /usr/share/sgml/docbook/yelp/docbook/html/docbook.xsl /usr/local/share/sgml/docbook/stylesheet/xsl/nwalsh/html/docbook.xsl /usr/local/share/sgml/docbook/yelp/docbook/html/docbook.xsl /usr/share/docbook-xsl/html/docbook.xsl +do + if test -f "$_try_docbook_xsl" + then + _docbook_xsl=$_try_docbook_xsl + break + fi +done + +if test -z "$_docbook_xsl" +then + _docbook_xsl=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/html/docbook.xsl + echo "Not found. Using default ($_docbook_xsl)" + _fake_docbook_xsl=yes +else + echo "Found docbook.xsl at $_docbook_xsl" +fi + +cat > html-chunk.xsl << EOF + + + + + + + + +EOF + + cat > html.xsl << EOF + + + diff -r bd4a5a954644 -r 6dfed0b2a300 DOCS/xml/ru/html-single.xsl --- a/DOCS/xml/ru/html-single.xsl Mon Oct 20 00:58:46 2003 +0000 +++ b/DOCS/xml/ru/html-single.xsl Mon Oct 20 09:56:48 2003 +0000 @@ -1,15 +1,8 @@ - - - - - + diff -r bd4a5a954644 -r 6dfed0b2a300 DOCS/xml/ru/html.xsl --- a/DOCS/xml/ru/html.xsl Mon Oct 20 00:58:46 2003 +0000 +++ b/DOCS/xml/ru/html.xsl Mon Oct 20 09:56:48 2003 +0000 @@ -1,15 +1,8 @@ - - - - - +