Mercurial > mplayer.hg
changeset 11188:6dfed0b2a300
Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)
author | lumag |
---|---|
date | Mon, 20 Oct 2003 09:56:48 +0000 |
parents | bd4a5a954644 |
children | 8b43f6485ac0 |
files | DOCS/xml/.cvsignore DOCS/xml/Makefile DOCS/xml/Makefile.inc DOCS/xml/README.maintainers DOCS/xml/configure DOCS/xml/en/Makefile DOCS/xml/es/Makefile DOCS/xml/fr/Makefile DOCS/xml/pl/Makefile DOCS/xml/pl/html-chunk.xsl DOCS/xml/pl/html-common.xsl DOCS/xml/pl/html-single.xsl DOCS/xml/pl/html.xsl DOCS/xml/ru/Makefile DOCS/xml/ru/html-chunk.xsl DOCS/xml/ru/html-common.xsl DOCS/xml/ru/html-single.xsl DOCS/xml/ru/html.xsl |
diffstat | 18 files changed, 212 insertions(+), 57 deletions(-) [+] |
line wrap: on
line diff
--- 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
--- 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
--- 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
--- 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 <book lang="XX"> 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: + + <?xml version="1.0" encoding="ISO-8859-1"?> + <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0"> + + <xsl:import href="../html.xsl"/> + <xsl:include href="html-common.xsl"/> - <xsl:import href="../html.xsl"/> + </xsl:stylesheet> + + html-chunk.xsl: + + <?xml version="1.0" encoding="ISO-8859-1"?> + <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0"> + + <xsl:import href="../html-chunk.xsl"/> + <xsl:include href="html-common.xsl"/> + + </xsl:stylesheet> + 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 <xsl:import .../> 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 <xsl:stylesheet ...> and </xsl:stylesheet> tags + (please, pay attention to quotes): <xsl:param name="chunker.output.encoding" select="'your_encoding'"/> - - Use ru/html.xsl as example. + <xsl:output encoding="your_encoding"/> + + 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 <?xml ... ?> tag you must put a note like <!-- synced with 1.2 -->, where 1.2 is the revision of corresponding English file (see comment at the top of file).
--- 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 +<?xml version="1.0" encoding="ISO-8859-1"?> +<!-- ************************************************** + This file is generated automatically. DO NOT EDIT. + ************************************************** --> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0"> + + <xsl:import href="$_chunk_xsl"/> + <xsl:include href="html-common.xsl"/> + +</xsl:stylesheet> +EOF + + cat > html.xsl << EOF <?xml version="1.0" encoding="ISO-8859-1"?> <!-- ************************************************** @@ -52,7 +87,7 @@ <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> - <xsl:import href="$_chunk_xsl"/> + <xsl:import href="$_docbook_xsl"/> <xsl:include href="html-common.xsl"/> </xsl:stylesheet> @@ -114,7 +149,28 @@ then if test -z "$_fake_chunk_xsl" then - _xsltcommand="cd \$1 && if test \"\`dirname \$2 | head -c 1\`\" = \".\" ; then $_java -classpath $_saxon_jar com.icl.saxon.StyleSheet \$_IN_DIR/\$3 \$_IN_DIR/\$2 ; else $_java -classpath $_saxon_jar com.icl.saxon.StyleSheet \$_IN_DIR/\$3 \$2 ;fi" +# _xsltcommand="cd \$1 && if test \"\`dirname \$2 | head -c 1\`\" = \".\" ; then $_java -classpath $_saxon_jar com.icl.saxon.StyleSheet \$_IN_DIR/\$3 \$_IN_DIR/\$2 ; else $_java -classpath $_saxon_jar com.icl.saxon.StyleSheet \$_IN_DIR/\$3 \$2 ;fi" + _xsltcommand=" +if test \"\`dirname \$2 | head -c 1\`\" = \".\" +then + _STYLESHEET=\$_IN_DIR/\$2 +else + _STYLESHEET=\$2 +fi + +if test -d \$1 +then + _DIRNAME=\"\$1\" + _OUTPUT=\"\" +else + _DIRNAME=\"\`dirname \$1\`\" + _OUTPUT=\"-o \`basename \$1\`\" +fi + +cd \$_DIRNAME && + java -classpath /usr/share/java/saxon.jar com.icl.saxon.StyleSheet \$_OUTPUT \$_IN_DIR/\$3 \$_STYLESHEET + " + echo "Found the Saxon XSLT Processor ($_saxon_jar), using Java VM '$_java'." else echo "Found the Saxon XSLT processor but no stylesheets on your system." @@ -189,11 +245,12 @@ chmod +x $_xsltwrapper - +echo "Searching xml checker..." for _try_xmllint in xmllint do - if command -v $_try_xmllint + if command -v $_try_xmllint > /dev/null then + echo "Found: $_try_xmllint" if test -n "$_catalog" then _xmllint_command="$_try_xmllint --noout --noent --postvalid --catalogs \$*" @@ -206,6 +263,7 @@ if test -z "$_xmllint_command" then + echo "Not found" _xmllint_command=true fi
--- a/DOCS/xml/en/Makefile Mon Oct 20 00:58:46 2003 +0000 +++ b/DOCS/xml/en/Makefile Mon Oct 20 09:56:48 2003 +0000 @@ -8,3 +8,4 @@ # Dependency information. $(HTMLDIR)/index.html: $(wildcard *.xml) +$(HTMLFILE): $(wildcard *.xml)
--- a/DOCS/xml/es/Makefile Mon Oct 20 00:58:46 2003 +0000 +++ b/DOCS/xml/es/Makefile Mon Oct 20 09:56:48 2003 +0000 @@ -8,3 +8,4 @@ # Dependency information. $(HTMLDIR)/index.html: $(wildcard *.xml) +$(HTMLFILE): $(wildcard *.xml)
--- a/DOCS/xml/fr/Makefile Mon Oct 20 00:58:46 2003 +0000 +++ b/DOCS/xml/fr/Makefile Mon Oct 20 09:56:48 2003 +0000 @@ -8,3 +8,4 @@ # Dependency information. $(HTMLDIR)/index.html: $(wildcard *.xml) +$(HTMLFILE): $(wildcard *.xml)
--- a/DOCS/xml/pl/Makefile Mon Oct 20 00:58:46 2003 +0000 +++ b/DOCS/xml/pl/Makefile Mon Oct 20 09:56:48 2003 +0000 @@ -7,4 +7,5 @@ USE_SYMLINKS = yes # Dependency information. -$(HTMLDIR)/index.html: $(wildcard *.xml) +$(HTMLDIR)/index.html: $(wildcard *.xml) html-common.xsl +$(HTMLFILE): $(wildcard *.xml) html-common.xsl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DOCS/xml/pl/html-chunk.xsl Mon Oct 20 09:56:48 2003 +0000 @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0"> + + <xsl:import href="../html-chunk.xsl"/> + <xsl:include href="html-common.xsl"/> + +</xsl:stylesheet>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DOCS/xml/pl/html-common.xsl Mon Oct 20 09:56:48 2003 +0000 @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> + +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0"> + + <xsl:param name="chunker.output.encoding" select="'utf-8'"/> + <xsl:output encoding="utf-8"/> + +</xsl:stylesheet>
--- a/DOCS/xml/pl/html-single.xsl Mon Oct 20 00:58:46 2003 +0000 +++ b/DOCS/xml/pl/html-single.xsl Mon Oct 20 09:56:48 2003 +0000 @@ -1,12 +1,8 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:import href="../html.xsl"/> - <xsl:param name="chunker.output.encoding" select="'utf-8'"/> + <xsl:include href="html-common.xsl"/> </xsl:stylesheet> - - - -
--- a/DOCS/xml/pl/html.xsl Mon Oct 20 00:58:46 2003 +0000 +++ b/DOCS/xml/pl/html.xsl Mon Oct 20 09:56:48 2003 +0000 @@ -1,12 +1,8 @@ -<?xml version="1.0" encoding="utf-8"?> +<?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:import href="../html.xsl"/> - <xsl:param name="chunker.output.encoding" select="'utf-8'"/> + <xsl:include href="html-common.xsl"/> </xsl:stylesheet> - - - -
--- a/DOCS/xml/ru/Makefile Mon Oct 20 00:58:46 2003 +0000 +++ b/DOCS/xml/ru/Makefile Mon Oct 20 09:56:48 2003 +0000 @@ -7,4 +7,5 @@ USE_SYMLINKS = yes # Dependency information. -$(HTMLDIR)/index.html: $(wildcard *.xml) +$(HTMLDIR)/index.html: $(wildcard *.xml) html-common.xsl +$(HTMLFILE): $(wildcard *.xml) html-common.xsl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DOCS/xml/ru/html-chunk.xsl Mon Oct 20 09:56:48 2003 +0000 @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0"> + + <xsl:import href="../html-chunk.xsl"/> + <xsl:include href="html-common.xsl"/> + +</xsl:stylesheet>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/DOCS/xml/ru/html-common.xsl Mon Oct 20 09:56:48 2003 +0000 @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="ISO-8859-1"?> + +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version="1.0"> + + <xsl:param name="chunker.output.encoding" select="'KOI8-R'"/> + <xsl:output encoding="KOI8-R"/> + + <!-- This forces Saxon to output chars from KOI8-R as is and not as something like Ƽ + WARNING: This will probably work with HTML output, and won't with output XML. + Anyway, this file will generate only HTML :) + --> + <xsl:param name="saxon.character.representation" select="'native;decimal'"/> + +</xsl:stylesheet>
--- 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 @@ <?xml version="1.0" encoding="ISO-8859-1"?> - <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:import href="../html.xsl"/> - <xsl:param name="chunker.output.encoding" select="'KOI8-R'"/> - - <!-- This forces Saxon to output chars from KOI8-R as is and not as something like Ƽ - WARNING: This will probably work with HTML output, and won't with output XML. - Anyway, this file will generate only HTML :) - --> - <xsl:param name="saxon.character.representation" select="'native;decimal'"/> + <xsl:include href="html-common.xsl"/> </xsl:stylesheet>
--- 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 @@ <?xml version="1.0" encoding="ISO-8859-1"?> - <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:import href="../html.xsl"/> - <xsl:param name="chunker.output.encoding" select="'KOI8-R'"/> - - <!-- This forces Saxon to output chars from KOI8-R as is and not as something like Ƽ - WARNING: This will probably work with HTML output, and won't with output XML. - Anyway, this file will generate only HTML :) - --> - <xsl:param name="saxon.character.representation" select="'native;decimal'"/> + <xsl:include href="html-common.xsl"/> </xsl:stylesheet>