changeset 28:02fc5e96a305

Moving decision logic from Makefile to XSLT because there is no simple way to force Gmake to use the $(OUT)/%_module.html target instead of $(OUT)/%.html target.
author Igor Sysoev <igor@sysoev.ru>
date Thu, 29 Sep 2011 14:14:55 +0000
parents 1201fabeccf7
children 3cc1fbdc53e8
files GNUmakefile xsls/article.xsls xsls/module.xsls
diffstat 3 files changed, 32 insertions(+), 70 deletions(-) [+]
line wrap: on
line diff
--- a/GNUmakefile	Thu Sep 29 12:46:58 2011 +0000
+++ b/GNUmakefile	Thu Sep 29 14:14:55 2011 +0000
@@ -46,13 +46,6 @@
 		dtd/article.dtd						\
 		dtd/content.dtd						\
 
-MODULE_XSLT =	xml/menu.xml						\
-		xml/versions.xml					\
-		xslt/module.xslt					\
-		xslt/directive.xslt					\
-		dtd/module.dtd						\
-		dtd/content.dtd						\
-
 include 	xml/en/GNUmakefile
 include 	xml/ja/GNUmakefile
 include 	xml/he/GNUmakefile
@@ -98,11 +91,6 @@
 
 .SECONDARY:
 
-$(OUT)/%_module.html:		xml/%_module.xml			\
-		$(MODULE_XSLT)
-	$(call XSLT, xslt/module.xslt, $<, $@)
-
-
 $(OUT)/%.html:		xml/%.xml					\
 		$(ARTICLE_XSLT)
 	$(call XSLT, xslt/article.xslt, $<, $@)
--- a/xsls/article.xsls	Thu Sep 29 12:46:58 2011 +0000
+++ b/xsls/article.xsls	Thu Sep 29 14:14:55 2011 +0000
@@ -12,7 +12,7 @@
 X:param YEAR;
 
 X:var SITE = "'http://nginx.org'";
-X:var LINK = "/article/@link";
+X:var LINK = "/article/@link | /module/@link";
 
 X:include href = "dirname.xslt";
 X:include href = "link.xslt";
@@ -20,6 +20,7 @@
 X:include href = "body.xslt";
 X:include href = "menu.xslt";
 X:include href = "donate.xslt";
+X:include href = "directive.xslt";
 X:include href = "content.xslt";
 X:include href = "versions.xslt";
 
@@ -54,4 +55,34 @@
 }
 
 
+X:template = "/module" {
+    <html><head>
+
+    <title> !{@title} </title>
+
+    !style (lang="/module/@lang")
+
+    </head>
+
+    !body (lang="/module/@lang")
+
+    </html>
 }
+
+
+X:template = "/module[@lang='he']" {
+    <html dir="rtl"><head>
+
+    <title> !{@title} </title>
+
+    !style (lang="/module/@lang")
+
+    </head>
+
+    !body (lang="/module/@lang")
+
+    </html>
+}
+
+
+}
--- a/xsls/module.xsls	Thu Sep 29 12:46:58 2011 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-X:stylesheet {
-
-X:output method="html" indent="no" encoding="utf-8";
-
-X:strip-space elements = "*";
-
-<!--
-  -- a current directory of a XSLT script is where the script is stored,
-  -- but not where XSLT processor has been started to run the script
-  -->
-X:param XML = "'../xml'"; 
-X:param YEAR;
-
-X:var SITE = "'http://nginx.org'";
-X:var LINK = "/module/@link";
-
-X:include href = "dirname.xslt";
-X:include href = "link.xslt";
-X:include href = "style.xslt";
-X:include href = "body.xslt";
-X:include href = "menu.xslt";
-X:include href = "directive.xslt";
-X:include href = "content.xslt";
-X:include href = "versions.xslt";
-
-
-X:template = "/module" {
-    <html><head>
-
-    <title> !{@title} </title>
-
-    !style (lang="/module/@lang")
-
-    </head>
-
-    !body (lang="/module/@lang")
-
-    </html>
-}
-
-
-X:template = "/module[@lang='he']" {
-    <html dir="rtl"><head>
-
-    <title> !{@title} </title>
-
-    !style (lang="/module/@lang")
-
-    </head>
-
-    !body (lang="/module/@lang")
-
-    </html>
-}
-
-
-}