[PATCH REMINDER] Make it possible to use customisation layers

Øyvind A. Holm sunny at sunbase.org
Tue Aug 22 14:10:16 CDT 2006


This is the patch I posted at 2006-08-12, is it accepted? It’s quite 
trivial and shouldn’t introduce any problems.

[[[
Enable local customization layers for all languages. If a specific 
language needs to customize the stylesheets, a local "stylesheets/" 
directory can be created, containing {html,chunk,fo}-stylesheet.xsl 
files.

Thanks to maxb for valuable feedback on the patch.

* src/tools/Makefile.base-rules
  (XSL_DIR): New variable.

* src/tools/Makefile.base-vars
  (html, html-chunk, fo): Execute $(XSLTPROC) with stylesheets in 
    $(XSL_DIR) instead of $(TOOLS_DIR).

* src/nb/stylesheets/chunk-stylesheet.xsl
* src/nb/stylesheets/fo-stylesheet.xsl
* src/nb/stylesheets/html-stylesheet.xsl
  New files, enables custom style sheets for the Norwegian book. No 
  layout changes, only imports the master stylesheets from 
  ../../src/tools/.
]]]

Attachment:
a93d61f60d4c33ae89857b1353760d20  layers.r2395.patch

欧理文 侯尔姆
N 60.42541° E 5.29959°
-------------------------------
svn rm SCO; svn ci -m "Oh yeah"
-------------- next part --------------
Index: src/nb/stylesheets/fo-stylesheet.xsl
===================================================================
--- src/nb/stylesheets/fo-stylesheet.xsl	(revision 0)
+++ src/nb/stylesheets/fo-stylesheet.xsl	(revision 0)
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+  <xsl:import href="../../tools/fo-stylesheet.xsl"/>
+</xsl:stylesheet>

Property changes on: src/nb/stylesheets/fo-stylesheet.xsl
___________________________________________________________________
Name: svn:eol-style
   + native

Index: src/nb/stylesheets/html-stylesheet.xsl
===================================================================
--- src/nb/stylesheets/html-stylesheet.xsl	(revision 0)
+++ src/nb/stylesheets/html-stylesheet.xsl	(revision 0)
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+  <xsl:import href="../../tools/html-stylesheet.xsl"/>
+</xsl:stylesheet>

Property changes on: src/nb/stylesheets/html-stylesheet.xsl
___________________________________________________________________
Name: svn:eol-style
   + native

Index: src/nb/stylesheets/chunk-stylesheet.xsl
===================================================================
--- src/nb/stylesheets/chunk-stylesheet.xsl	(revision 0)
+++ src/nb/stylesheets/chunk-stylesheet.xsl	(revision 0)
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+  <xsl:import href="../../tools/chunk-stylesheet.xsl"/>
+</xsl:stylesheet>

Property changes on: src/nb/stylesheets/chunk-stylesheet.xsl
___________________________________________________________________
Name: svn:eol-style
   + native

Index: src/tools/Makefile.base-vars
===================================================================
--- src/tools/Makefile.base-vars	(revision 2395)
+++ src/tools/Makefile.base-vars	(working copy)
@@ -36,6 +36,7 @@
 DIR = .
 IMAGES =
 TOOLS_DIR = ../tools
+XSL_DIR = `[ -d stylesheets ] && echo stylesheets || echo $(TOOLS_DIR)`
 OUTNAME = $(NAME)
 
 HTML_CHUNK_DIR = $(DIR)/html-chunk
Index: src/tools/Makefile.base-rules
===================================================================
--- src/tools/Makefile.base-rules	(revision 2395)
+++ src/tools/Makefile.base-rules	(working copy)
@@ -24,7 +24,7 @@
 $(HTML_TARGET): $(ALL_SOURCE) $(VERSION_SOURCE) $(STYLESHEET) $(IMAGES)
 	$(ENSURE_XSL)
 	$(XSLTPROC) $(HTML_XSLTPROC_OPTS) --output $(HTML_TARGET) \
-	  $(TOOLS_DIR)/html-stylesheet.xsl $(XML_SOURCE)
+	  $(XSL_DIR)/html-stylesheet.xsl $(XML_SOURCE)
 
 # The trailing slash on the xsltproc --output option is essential to
 # output pages into the directory
@@ -35,7 +35,7 @@
 	$(ENSURE_XSL)
 	$(XSLTPROC) $(HTML_XSLTPROC_OPTS) \
            --output $(HTML_CHUNK_DIR)/ \
-	   $(TOOLS_DIR)/chunk-stylesheet.xsl $(XML_SOURCE)
+	   $(XSL_DIR)/chunk-stylesheet.xsl $(XML_SOURCE)
 	cp $(STYLESHEET) $(HTML_CHUNK_DIR)
 	$(IFIMAGES) cp $(IMAGES) $(HTML_CHUNK_DIR)/images $(ENDIF)
 
@@ -58,7 +58,7 @@
 $(FO_TARGET): $(ALL_SOURCE) $(VERSION_SOURCE) $(IMAGES)
 	$(ENSURE_XSL)
 	$(XSLTPROC) $(FO_XSLTPROC_OPTS) --output $(FO_TARGET) \
-	  $(TOOLS_DIR)/fo-stylesheet.xsl $(XML_SOURCE)
+	  $(XSL_DIR)/fo-stylesheet.xsl $(XML_SOURCE)
 
 pdf: $(PDF_TARGET)
 $(PDF_TARGET): $(FO_TARGET) $(IMAGES)


More information about the svnbook-dev mailing list