Mercurial > hg > nginx-site
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 +++ b/GNUmakefile @@ -46,13 +46,6 @@ ARTICLE_XSLT = xml/menu.xml \ 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 @@ include xml/tr/GNUmakefile .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 +++ b/xsls/article.xsls @@ -12,7 +12,7 @@ X:param XML = "'../xml'"; 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 = "style.xslt"; 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 = "/article[@lang='he']" { } +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> +} + + +}
deleted file mode 100644 --- a/xsls/module.xsls +++ /dev/null @@ -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> -} - - -}