# HG changeset patch # User Igor Sysoev # Date 1317305695 0 # Node ID 02fc5e96a3056a3b58d9953641650ead67e4e9ac # Parent 1201fabeccf71f567bdf9408a4e4c680c64dbed7 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. diff -r 1201fabeccf7 -r 02fc5e96a305 GNUmakefile --- 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, $<, $@) diff -r 1201fabeccf7 -r 02fc5e96a305 xsls/article.xsls --- 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" { + + + !{@title} + + !style (lang="/module/@lang") + + + + !body (lang="/module/@lang") + + } + + +X:template = "/module[@lang='he']" { + + + !{@title} + + !style (lang="/module/@lang") + + + + !body (lang="/module/@lang") + + +} + + +} diff -r 1201fabeccf7 -r 02fc5e96a305 xsls/module.xsls --- 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 = "*"; - - -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" { - - - !{@title} - - !style (lang="/module/@lang") - - - - !body (lang="/module/@lang") - - -} - - -X:template = "/module[@lang='he']" { - - - !{@title} - - !style (lang="/module/@lang") - - - - !body (lang="/module/@lang") - - -} - - -}