[svnbook commit] r3468 - Merge style sheets, move fop.extensions to FO_XSLTPROC_OPTS, add FOP_CFG

codesite-noreply at google.com codesite-noreply at google.com
Fri Apr 3 00:13:06 CDT 2009


Author: dongsheng.song at gmail.com
Date: Thu Apr  2 19:45:00 2009
New Revision: 3468

Added:
    trunk/src/zh/stylesheets/chunk.xsl   (contents, props changed)
       - copied, changed from r3467, /trunk/src/zh/stylesheets/zh/chunk.xsl
    trunk/src/zh/stylesheets/fo.xsl   (contents, props changed)
       - copied, changed from r3467, /trunk/src/zh/stylesheets/zh/fo.xsl
    trunk/src/zh/stylesheets/html.xsl   (contents, props changed)
       - copied, changed from r3467, /trunk/src/zh/stylesheets/zh/html.xsl
Removed:
    trunk/src/zh/stylesheets/zh/
Modified:
    trunk/src/de/Makefile
    trunk/src/en/Makefile
    trunk/src/tools/Makefile.base-po
    trunk/src/tools/base-html-stylesheet.xsl
    trunk/src/tools/bin/run-fop.sh
    trunk/src/tools/chunk-stylesheet.xsl
    trunk/src/tools/fo-stylesheet.xsl
    trunk/src/tools/html-stylesheet.xsl
    trunk/src/zh/Makefile

Log:
Merge style sheets, move fop.extensions to FO_XSLTPROC_OPTS, add FOP_CFG
to run-fop.sh. Now we can use fop 0.20.5 for en and de, fop trunk for zh.


Modified: trunk/src/de/Makefile
==============================================================================
--- trunk/src/de/Makefile	(original)
+++ trunk/src/de/Makefile	Thu Apr  2 19:45:00 2009
@@ -1,4 +1,4 @@
  include ../tools/Makefile.base
  # Customization hooks for xsltproc options
  HTML_XSLTPROC_OPTS = --stringparam l10n.gentext.language de
-FO_XSLTPROC_OPTS = --stringparam paper.type A4 --stringparam  
l10n.gentext.language de
+FO_XSLTPROC_OPTS = --param fop.extensions 1 --stringparam paper.type A4  
--stringparam l10n.gentext.language de

Modified: trunk/src/en/Makefile
==============================================================================
--- trunk/src/en/Makefile	(original)
+++ trunk/src/en/Makefile	Thu Apr  2 19:45:00 2009
@@ -1,2 +1,3 @@
  include ../tools/Makefile.base
+FO_XSLTPROC_OPTS = --param fop.extensions 1
  L10N_REVISION = r

Modified: trunk/src/tools/Makefile.base-po
==============================================================================
--- trunk/src/tools/Makefile.base-po	(original)
+++ trunk/src/tools/Makefile.base-po	Thu Apr  2 19:45:00 2009
@@ -48,30 +48,32 @@
  	$(MAKE) tidypo

  build/source/svnbook.xml: $(filter-out ../en/book/version.xml,  
$(wildcard ../en/book/*.xml)) po/svnbook.po
-	mkdir -p build/source/images book
-	cp stylesheets/styles.css build/source
+	mkdir -p build/source/images
  	cp ../en/book/images/*.png build/source/images
+	cp ../en/book/*.xml build/source
+	cp stylesheets/styles.css build/source
  	cp images/*.png build/source/images
-	cp ../en/book/*.xml book

-	cat book/book.xml | \
+	cat build/source/book.xml | \
  	   
sed 's/..\/..\/tools\/dtd\/docbook-4.4\/docbookx.dtd/http:\/\/www.oasis-open.org\/docbook\/xml\/4.5\/docbookx.dtd/'  
\
-	  > book/book.xml.tmp
-	mv book/book.xml.tmp book/book.xml
+	  > build/source/book.xml.tmp
+	mv build/source/book.xml.tmp build/source/book.xml
  	@if svn info . > /dev/null; then \
-	  echo '<!ENTITY svn.l10n_revision "'`LC_ALL=C svn info po |  
awk '{if(/^Last Changed Rev/) print "r"$$4}'`'">' > book/version.xml.tmp; \
-	  echo '<!ENTITY svn.version "'`LC_ALL=C svn info ../en/book |  
awk '{if(/^Last Changed Rev/) print "/r"$$4}'`'">' >> book/version.xml.tmp;  
\
+	  echo '<!ENTITY svn.l10n_revision "'`LC_ALL=C svn info po |  
awk '{if(/^Last Changed Rev/) print "r"$$4}'`'">' > \
+	    build/source/version.xml.tmp; \
+	  echo '<!ENTITY svn.version "'`LC_ALL=C svn info ../en/book |  
awk '{if(/^Last Changed Rev/) print "/r"$$4}'`'">' >> \
+	    build/source/version.xml.tmp; \
  	else \
-	  echo '<!ENTITY svn.l10n_revision "'`date +%Y-%m-%d`'">' >  
book/version.xml.tmp; \
-	  echo '<!ENTITY svn.version "">' >> book/version.xml.tmp; \
+	  echo '<!ENTITY svn.l10n_revision "'`date +%Y-%m-%d`'">' >  
build/source/version.xml.tmp; \
+	  echo '<!ENTITY svn.version "">' >> build/source/version.xml.tmp; \
  	fi
-	@if cmp -s book/version.xml book/version.xml.tmp; then \
-	  rm book/version.xml.tmp; \
+	@if cmp -s build/source/version.xml build/source/version.xml.tmp; then \
+	  rm build/source/version.xml.tmp; \
  	else \
-	  mv book/version.xml.tmp book/version.xml; \
+	  mv build/source/version.xml.tmp build/source/version.xml; \
  	fi

-	xmllint --nonet --noent --xinclude --postvalid --output  
build/source/svnbook-en.xml book/book.xml
+	xmllint --nonet --noent --xinclude --postvalid --output  
build/source/svnbook-en.xml build/source/book.xml
  	$(TRANSLATE) -m build/source/svnbook-en.xml -p po/svnbook.po -l  
build/source/svnbook.xml
  	$(MAKE) validate

@@ -84,31 +86,31 @@
  	(cd build/source; ../../../tools/xsl/epub/bin/dbtoepub -c styles.css -v  
svnbook.xml; mv svnbook.epub ..)

  html-chunk: build/svnbook-html-chunk/index.html
-build/svnbook-html-chunk/index.html: build/source/svnbook.xml  
stylesheets/chunk.xsl stylesheets/$(LINGUA)/chunk.xsl
+build/svnbook-html-chunk/index.html: build/source/svnbook.xml  
stylesheets/chunk.xsl ../tools/base-html-stylesheet.xsl ../tools/chunk-stylesheet.xsl
  	$(ENSURE_XSL)
  	mkdir -p build/svnbook-html-chunk/images
  	cp build/source/styles.css build/svnbook-html-chunk
  	cp build/source/images/*.png build/svnbook-html-chunk/images
  	xsltproc --output build/svnbook-html-chunk/ \
-	    stylesheets/$(LINGUA)/chunk.xsl build/source/svnbook.xml
+	    stylesheets/chunk.xsl build/source/svnbook.xml
  	(cd build; tar czf svnbook-html-chunk.tgz svnbook-html-chunk)

  html: build/svnbook-html/svnbook.html
-build/svnbook-html/svnbook.html: build/source/svnbook.xml  
stylesheets/html.xsl stylesheets/$(LINGUA)/html.xsl
+build/svnbook-html/svnbook.html: build/source/svnbook.xml  
stylesheets/html.xsl ../tools/base-html-stylesheet.xsl ../tools/html-stylesheet.xsl
  	$(ENSURE_XSL)
  	mkdir -p build/svnbook-html/images
  	cp ../en/book/styles.css build/svnbook-html
  	cp ../en/book/images/*.png build/svnbook-html/images
  	xsltproc --output build/svnbook-html/svnbook.html \
-	    stylesheets/$(LINGUA)/html.xsl build/source/svnbook.xml
+	    stylesheets/html.xsl build/source/svnbook.xml
  	(cd build; tar czf svnbook-html.tgz svnbook-html)

  #
  # Requires at least fop 0.96 and configure Chinese fonts
  #
  pdf: build/svnbook.pdf
-build/svnbook.pdf: build/source/svnbook.xml stylesheets/fo.xsl  
stylesheets/$(LINGUA)/fo.xsl
+build/svnbook.pdf: build/source/svnbook.xml  
stylesheets/fo.xsl ../tools/fo-stylesheet.xsl
  	$(ENSURE_XSL)
  	xsltproc --output build/source/svnbook.fo --param fop1.extensions 1 \
-	    stylesheets/$(LINGUA)/fo.xsl build/source/svnbook.xml
+	    stylesheets/fo.xsl build/source/svnbook.xml
  	(cd build/source && ../../../tools/fop1.sh  
-c ../../../tools/fop1-userconfig.xml svnbook.fo ../svnbook.pdf)

Modified: trunk/src/tools/base-html-stylesheet.xsl
==============================================================================
--- trunk/src/tools/base-html-stylesheet.xsl	(original)
+++ trunk/src/tools/base-html-stylesheet.xsl	Thu Apr  2 19:45:00 2009
@@ -1,14 +1,27 @@
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  
version='1.0'>

+  <!-- xsltproc can't support these extensions
+  <xsl:param name="use.extensions">1</xsl:param>
+  <xsl:param name="callouts.extension">1</xsl:param>
+  <xsl:param name="linenumbering.extension">1</xsl:param>
+  <xsl:param name="tablecolumns.extension">1</xsl:param>
+  <xsl:param name="textinsert.extension">1</xsl:param>
+  -->
+
    <xsl:param name="html.stylesheet">styles.css</xsl:param>
    <xsl:param name="toc.section.depth">3</xsl:param>
    <xsl:param name="annotate.toc">0</xsl:param>

+  <xsl:param name="admon.graphics" select="1" />
+  <xsl:param name="admon.graphics.extension">.png</xsl:param>
+  <xsl:param name="callout.graphics" select="1" />
+  <xsl:param name="callout.graphics.extension">.png</xsl:param>
+
    <xsl:template match="sect1" mode="toc">
      <xsl:param name="toc-context" select="."/>
      <xsl:call-template name="subtoc">
        <xsl:with-param name="toc-context" select="$toc-context"/>
-      <xsl:with-param name="nodes"
+      <xsl:with-param name="nodes"
          select="sect2|refentry|bridgehead[$bridgehead.in.toc != 0]"/>
      </xsl:call-template>
    </xsl:template>
@@ -18,7 +31,7 @@

      <xsl:call-template name="subtoc">
        <xsl:with-param name="toc-context" select="$toc-context"/>
-      <xsl:with-param name="nodes"
+      <xsl:with-param name="nodes"
          select="sect3|refentry|bridgehead[$bridgehead.in.toc != 0]"/>
      </xsl:call-template>
    </xsl:template>

Modified: trunk/src/tools/bin/run-fop.sh
==============================================================================
--- trunk/src/tools/bin/run-fop.sh	(original)
+++ trunk/src/tools/bin/run-fop.sh	Thu Apr  2 19:45:00 2009
@@ -8,6 +8,9 @@
  # Arguments are passed along to `fop'.

  # If the user has a .foprc, source it.
+if [ -f "$HOME/.fop/fop.conf" ] ; then
+  . $HOME/.fop/fop.conf
+fi
  if [ -f ${HOME}/.foprc ]; then
    . ${HOME}/.foprc
  fi
@@ -44,4 +47,4 @@

  echo "(Using '${FOP_PGM}' for FOP)"

-${FOP_PGM} "$@"
+${FOP_PGM} ${FOP_CFG} "$@"

Modified: trunk/src/tools/chunk-stylesheet.xsl
==============================================================================
--- trunk/src/tools/chunk-stylesheet.xsl	(original)
+++ trunk/src/tools/chunk-stylesheet.xsl	Thu Apr  2 19:45:00 2009
@@ -1,10 +1,16 @@
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  
version='1.0'>

+  <!-- xsl:import  
href="http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl"/  
-->
    <xsl:import href="xsl/xhtml/chunk.xsl"/>
+
    <xsl:include href="base-html-stylesheet.xsl"/>

    <!-- PARAMETER REFERENCE:                                         -->
    <!-- http://docbook.sourceforge.net/release/xsl/current/doc/html/ -->
+
+  <xsl:param name="chunker.output.encoding" select="'utf-8'"/>
+  <xsl:param name="chunker.output.indent" select="'yes'"/>
+  <xsl:param name="chunk.section.depth">1</xsl:param>

    <!-- Uncomment this to enable auto-numbering of sections -->
    <!-- xsl:param name="section.autolabel" select="1" / -->

Modified: trunk/src/tools/fo-stylesheet.xsl
==============================================================================
--- trunk/src/tools/fo-stylesheet.xsl	(original)
+++ trunk/src/tools/fo-stylesheet.xsl	Thu Apr  2 19:45:00 2009
@@ -1,21 +1,70 @@
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  
version='1.0'>

+  <!-- xsl:import  
href="http://docbook.sourceforge.net/release/xsl/current/fo/docbook.xsl"/  
-->
    <xsl:import href="xsl/fo/docbook.xsl"/>

    <!-- PARAMETER REFERENCE:                                       -->
    <!-- http://docbook.sourceforge.net/release/xsl/current/doc/fo/ -->

+  <!-- Move to FO_XSLTPROC_OPTS for support fop1 and xep, etc.
    <xsl:param name="fop.extensions" select="1" />
-  <xsl:param name="variablelist.as.blocks" select="1" />
+  -->
+
+  <!-- xsltproc can't support these extensions
+  <xsl:param name="use.extensions">1</xsl:param>
+  <xsl:param name="callouts.extension">1</xsl:param>
+  <xsl:param name="linenumbering.extension">1</xsl:param>
+  <xsl:param name="tablecolumns.extension">1</xsl:param>
+  <xsl:param name="textinsert.extension">1</xsl:param>
+  -->
+
+  <!-- Page related Settings -->
+  <xsl:param name="page.margin.inner">1.5cm</xsl:param>
+  <xsl:param name="page.margin.outer">1.5cm</xsl:param>
+  <xsl:param name="title.margin.left">0pt</xsl:param>
    <xsl:param name="body.start.indent">0pt</xsl:param>
+  <xsl:param name="body.end.indent">0pt</xsl:param>
+
+  <!-- Custom font settings -->
+  <xsl:param name="title.font.family">sans-serif,SimHei</xsl:param>
    <xsl:param name="body.font.family">serif,SimSun</xsl:param>
+  <xsl:param name="sans.font.family">sans-serif,SimHei</xsl:param>
    <xsl:param name="dingbat.font.family">serif,SimSun</xsl:param>
+  <xsl:param  
name="monospace.font.family">monospace,FangSong,SimSun</xsl:param>
+
+  <!-- Admonitions and callouts settings -->
    <xsl:param name="admon.textlabel" select="0" />
    <xsl:param name="admon.graphics" select="1" />
    <xsl:param name="admon.graphics.path">images/</xsl:param>
    <xsl:param name="admon.graphics.extension">.png</xsl:param>
+  <xsl:param name="callout.graphics" select="1" />
+  <xsl:param name="callout.graphics.extension">.png</xsl:param>
+
+  <xsl:param name="variablelist.as.blocks" select="1" />
+
    <!-- Uncomment this to enable auto-numbering of sections -->
    <!-- xsl:param name="section.autolabel" select="1" / -->
+
+  <!-- Breaking long lines -->
+  <xsl:param name="hyphenate.verbatim">1</xsl:param>
+  <xsl:attribute-set name="monospace.verbatim.properties"
+                     use-attribute-sets="verbatim.properties  
monospace.properties">
+    <xsl:attribute name="wrap-option">wrap</xsl:attribute>
+    <xsl:attribute name="hyphenation-character">&#x25BA;</xsl:attribute>
+  </xsl:attribute-set>
+
+  <!-- Colourize links in output -->
+  <xsl:attribute-set name="xref.properties">
+    <xsl:attribute name="color">
+      <xsl:choose>
+        <xsl:when test="self::ulink">blue</xsl:when>
+        <xsl:when test="self::xref">blue</xsl:when>
+        <xsl:when test="self::uri">blue</xsl:when>
+        <xsl:otherwise>red</xsl:otherwise>
+      </xsl:choose>
+    </xsl:attribute>
+  </xsl:attribute-set>
+
    <xsl:attribute-set name="sidebar.properties"  
use-attribute-sets="formal.object.properties">
      <xsl:attribute name="border-style">solid</xsl:attribute>
      <xsl:attribute name="border-width">.1mm</xsl:attribute>

Modified: trunk/src/tools/html-stylesheet.xsl
==============================================================================
--- trunk/src/tools/html-stylesheet.xsl	(original)
+++ trunk/src/tools/html-stylesheet.xsl	Thu Apr  2 19:45:00 2009
@@ -1,7 +1,11 @@
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  
version='1.0'>

+  <!-- xsl:import  
href="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/  
-->
    <xsl:import href="xsl/xhtml/docbook.xsl"/>
+
    <xsl:include href="base-html-stylesheet.xsl"/>
+
+  <xsl:output method="html" encoding="utf-8" indent="yes"/>

    <!-- PARAMETER REFERENCE:                                         -->
    <!-- http://docbook.sourceforge.net/release/xsl/current/doc/html/ -->

Modified: trunk/src/zh/Makefile
==============================================================================
--- trunk/src/zh/Makefile	(original)
+++ trunk/src/zh/Makefile	Thu Apr  2 19:45:00 2009
@@ -2,5 +2,4 @@
  # PO based Makefile for the svnbook
  #

-LINGUA=zh
  include ../tools/Makefile.base-po

Copied: trunk/src/zh/stylesheets/chunk.xsl (from r3467,  
/trunk/src/zh/stylesheets/zh/chunk.xsl)
==============================================================================
--- /trunk/src/zh/stylesheets/zh/chunk.xsl	(original)
+++ trunk/src/zh/stylesheets/chunk.xsl	Thu Apr  2 19:45:00 2009
@@ -1,7 +1,7 @@
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  
version='1.0'>

-  <xsl:import href="../chunk.xsl"/>
+  <xsl:import href="../../tools/chunk-stylesheet.xsl"/>

    <xsl:param name="l10n.gentext.language" select="'zh'"/>


Copied: trunk/src/zh/stylesheets/fo.xsl (from r3467,  
/trunk/src/zh/stylesheets/zh/fo.xsl)
==============================================================================
--- /trunk/src/zh/stylesheets/zh/fo.xsl	(original)
+++ trunk/src/zh/stylesheets/fo.xsl	Thu Apr  2 19:45:00 2009
@@ -3,12 +3,17 @@
                  xmlns:fo="http://www.w3.org/1999/XSL/Format"
                  version='1.0'>

-  <xsl:import href="../fo.xsl"/>
+  <xsl:import href="../../tools/fo-stylesheet.xsl"/>

    <xsl:param name="l10n.gentext.language" select="'zh'"/>

    <!-- Chinese font related settings -->
    <xsl:param name="body.font.master">12</xsl:param>
+  <xsl:param name="title.font.family">Calibri,sans-serif,SimHei</xsl:param>
+  <xsl:param name="body.font.family">Cambria,Cambria  
Math,serif,SimSun</xsl:param>
+  <xsl:param name="sans.font.family">Calibri,sans-serif,SimHei</xsl:param>
+  <xsl:param name="dingbat.font.family">Cambria,Cambria  
Math,serif,SimSun</xsl:param>
+  <xsl:param name="monospace.font.family">Courier  
New,monospace,FangSong</xsl:param>

    <xsl:attribute-set name="standard.para.spacing"  
use-attribute-sets="normal.para.spacing">
      <xsl:attribute name="text-indent">24pt</xsl:attribute>

Copied: trunk/src/zh/stylesheets/html.xsl (from r3467,  
/trunk/src/zh/stylesheets/zh/html.xsl)
==============================================================================
--- /trunk/src/zh/stylesheets/zh/html.xsl	(original)
+++ trunk/src/zh/stylesheets/html.xsl	Thu Apr  2 19:45:00 2009
@@ -1,7 +1,7 @@
  <?xml version="1.0"?>
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"  
version='1.0'>

-  <xsl:import href="../html.xsl"/>
+  <xsl:import href="../../tools/html-stylesheet.xsl"/>

    <xsl:param name="l10n.gentext.language" select="'zh'"/>





More information about the svnbook-dev mailing list