[PATCH] Add local customization layers for all languages, v3
Øyvind A. Holm
sunny at sunbase.org
Sat Aug 12 11:46:11 CDT 2006
On 2006-08-11 11:54:28 Max Bowsher wrote:
> Øyvind A. Holm wrote:
> > * src/tools/Makefile.base-rules
> > ($XSL_DIR): New variable.
>
> Just '(XSL_DIR)', please. $XSL_DIR isn't actually valid make syntax
> anyway, so it looks weird in a log message about a makefile.
Agree.
> > +XSL_DIR := $(shell if test -d "stylesheets"; then \
> > + echo stylesheets; else echo $(TOOLS_DIR); fi)
>
> $(shell ...) is a GNUism, as is := .
>
> Based on bin/find-xsl.py, we do have BSD users who would be a little
> annoyed by this change.
Argh, didn’t know it was GNUish. Yes, we want to avoid those.
> Instead, use something like:
>
> XSL_DIR = `[ -d stylesheets ] && echo stylesheets || echo $(TOOLS_DIR)`
Yep, seems like a more portable solution.
[[[
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:
616bd80b734447d27709c968b54cba80 layers.r2388.patch
sunny256
N 60.42541° E 5.29959°
----------------------
cat /dev/urandom >SCO
-------------- 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 2388)
+++ 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 2388)
+++ 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