[Mplayer-cvslog] CVS: main/DOCS/xml .cvsignore,1.1,1.2 Makefile,1.9,1.10 Makefile.inc,1.5,1.6 README.maintainers,1.7,1.8 configure,1.4,1.5

Dmitry Baryshkov CVS lumag at mplayerhq.hu
Mon Oct 20 11:57:15 CEST 2003


Update of /cvsroot/mplayer/main/DOCS/xml
In directory mail:/var/tmp.root/cvs-serv21313

Modified Files:
	.cvsignore Makefile Makefile.inc README.maintainers configure 
Log Message:
Add support for building all-in-one HTML docs. (Files go to DOCS/HTML-single)


Index: .cvsignore
===================================================================
RCS file: /cvsroot/mplayer/main/DOCS/xml/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore	18 Jun 2003 17:37:36 -0000	1.1
+++ .cvsignore	20 Oct 2003 09:56:10 -0000	1.2
@@ -1,3 +1,4 @@
 html.xsl
+html-chunk.xsl
 xsltproc.sh
 xmllint.sh

Index: Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/DOCS/xml/Makefile,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- Makefile	15 Oct 2003 17:00:25 -0000	1.9
+++ Makefile	20 Oct 2003 09:56:10 -0000	1.10
@@ -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-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 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 &&\
-		(test -d $(HTML_TOP)/$$dir || mkdir $(HTML_TOP)/$$dir) &&\
-		if $(MAKE) HTMLDIR=../$(HTML_TOP)/$$dir -C $$dir; then :; else exit 1; fi;\
+		if $(MAKE) HTMLFILE=../$(HTML_UNCHUNKED)/mplayer_docs_$$dir.html -C $$dir html; then :; else exit 1; fi;\
 	done
 
-.PHONY: clean-html
+.PHONY: clean-html-chunked
 clean-html:
 	-rm -rf $(HTML_TOP)
 
+.PHONY: clean-html
+clean-html:
+	-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

Index: Makefile.inc
===================================================================
RCS file: /cvsroot/mplayer/main/DOCS/xml/Makefile.inc,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Makefile.inc	8 Oct 2003 02:00:15 -0000	1.5
+++ Makefile.inc	20 Oct 2003 09:56:10 -0000	1.6
@@ -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

Index: README.maintainers
===================================================================
RCS file: /cvsroot/mplayer/main/DOCS/xml/README.maintainers,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- README.maintainers	16 Oct 2003 12:04:12 -0000	1.7
+++ README.maintainers	20 Oct 2003 09:56:10 -0000	1.8
@@ -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: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>
 
-	<xsl:import href="../html.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 <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).

Index: configure
===================================================================
RCS file: /cvsroot/mplayer/main/DOCS/xml/configure,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- configure	5 Oct 2003 01:06:30 -0000	1.4
+++ configure	20 Oct 2003 09:56:10 -0000	1.5
@@ -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,7 +45,26 @@
   echo "Found chunk.xsl at $_chunk_xsl"
 fi
 
-cat > html.xsl << EOF
+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.
@@ -59,6 +79,21 @@
 EOF
 
 
+cat > html.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="$_docbook_xsl"/>
+  <xsl:include href="html-common.xsl"/>
+
+</xsl:stylesheet>
+EOF
+
+
 
 echo "Looking for a valid XSLT processor..."
 # Checks for xsltproc, then checks for the Saxon processor (it needs Java).
@@ -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
 



More information about the MPlayer-cvslog mailing list