changeset 721:81ad082bc837

Simplified things by including books.xslt, download.xslt and security.xslt into article.xslt, and always using article.xslt to generate HTMLs. While here, moved versions.xml from common dependencies to article dependencies. Fixed menu in 404.html by applying templates from menu.xslt, and fixed its dependency on DTD.
author Ruslan Ermilov <ru@nginx.com>
date Fri, 12 Oct 2012 09:10:31 +0000
parents 9934338f83af
children 91dd4a7fadbb
files GNUmakefile xml/en/GNUmakefile xml/ru/GNUmakefile xsls/article.xsls xsls/books.xsls xsls/download.xsls xsls/error.xsls xsls/security.xsls
diffstat 8 files changed, 25 insertions(+), 174 deletions(-) [+]
line wrap: on
line diff
--- a/GNUmakefile	Thu Oct 11 10:23:05 2012 +0000
+++ b/GNUmakefile	Fri Oct 12 09:10:31 2012 +0000
@@ -46,7 +46,6 @@
 
 COMMON_DEPS =								\
 		xml/menu.xml						\
-		xml/versions.xml					\
 		xml/i18n.xml						\
 		dtd/content.dtd						\
 		xslt/dirname.xslt					\
@@ -59,11 +58,15 @@
 
 ARTICLE_DEPS =								\
 		$(COMMON_DEPS)						\
+		xml/versions.xml					\
 		dtd/article.dtd						\
 		dtd/module.dtd						\
 		xslt/article.xslt					\
+		xslt/books.xslt						\
+		xslt/directive.xslt					\
 		xslt/donate.xslt					\
-		xslt/directive.xslt					\
+		xslt/download.xslt					\
+		xslt/security.xslt					\
 		xslt/versions.xslt					\
 
 NEWS_DEPS =								\
@@ -71,21 +74,6 @@
 		dtd/news.dtd						\
 		xslt/news.xslt						\
 
-DOWNLOAD_DEPS =								\
-		$(COMMON_DEPS)						\
-		dtd/article.dtd						\
-		xslt/download.xslt					\
-
-SECURITY_DEPS =								\
-		$(COMMON_DEPS)						\
-		dtd/article.dtd						\
-		xslt/security.xslt					\
-
-BOOK_DEPS =								\
-		$(COMMON_DEPS)						\
-		dtd/article.dtd						\
-		xslt/books.xslt						\
-
 LANGS =		en ru cn he ja tr
 
 all:		news arx 404 $(LANGS)
@@ -120,10 +108,11 @@
 $(OUT)/404.html:							\
 		xml/404.xml						\
 		xml/menu.xml						\
-		dtd/article.dtd						\
-		dtd/content.dtd						\
-		xslt/ga.xslt						\
-		xslt/error.xslt
+		dtd/error.dtd						\
+		xslt/error.xslt						\
+		xslt/dirname.xslt					\
+		xslt/menu.xslt						\
+		xslt/ga.xslt
 	$(call XSLT, xslt/error.xslt, $<, $@)
 
 $(OUT)/%.html:	xml/%.xml						\
--- a/xml/en/GNUmakefile	Thu Oct 11 10:23:05 2012 +0000
+++ b/xml/en/GNUmakefile	Fri Oct 12 09:10:31 2012 +0000
@@ -100,16 +100,6 @@
 		$(OUT)/$(DOC_LANG)/support.html				\
 		$(OUT)/$(DOC_LANG)/donation.html			\
 
-$(OUT)/$(DOC_LANG)/download.html:					\
-		xml/$(DOC_LANG)/download.xml				\
-		$(DOWNLOAD_DEPS)
-	$(call XSLT, xslt/download.xslt, $<, $@)
-
-$(OUT)/$(DOC_LANG)/security_advisories.html:				\
-		xml/$(DOC_LANG)/security_advisories.xml			\
-		$(SECURITY_DEPS)
-	$(call XSLT, xslt/security.xslt, $<, $@)
-
 $(OUT)/$(DOC_LANG)/docs/index.html:					\
 		$(DOCS_XML)						\
 		$(REFS_XML)						\
@@ -126,8 +116,3 @@
 
 $(OUT)/$(DOC_LANG)/docs/faq.html:					\
 		$(FAQ_XML)						\
-
-$(OUT)/$(DOC_LANG)/books.html:						\
-		xml/$(DOC_LANG)/books.xml				\
-		$(BOOK_DEPS)
-	$(call XSLT, xslt/books.xslt, $<, $@)
--- a/xml/ru/GNUmakefile	Thu Oct 11 10:23:05 2012 +0000
+++ b/xml/ru/GNUmakefile	Fri Oct 12 09:10:31 2012 +0000
@@ -87,11 +87,6 @@
 		$(FAQ_HTML)						\
 		$(OUT)/$(DOC_LANG)/support.html				\
 
-$(OUT)/$(DOC_LANG)/download.html:					\
-		xml/$(DOC_LANG)/download.xml				\
-		$(DOWNLOAD_DEPS)
-	$(call XSLT, xslt/download.xslt, $<, $@)
-
 $(OUT)/$(DOC_LANG)/docs/index.html:					\
 		$(DOCS_XML)						\
 		$(REFS_XML)						\
--- a/xsls/article.xsls	Thu Oct 11 10:23:05 2012 +0000
+++ b/xsls/article.xsls	Fri Oct 12 09:10:31 2012 +0000
@@ -26,10 +26,13 @@
 X:include href = "style.xslt";
 X:include href = "body.xslt";
 X:include href = "menu.xslt";
-X:include href = "donate.xslt";
+X:include href = "ga.xslt";
+X:include href = "content.xslt";
+X:include href = "books.xslt";
 X:include href = "directive.xslt";
-X:include href = "content.xslt";
-X:include href = "ga.xslt";
+X:include href = "donate.xslt";
+X:include href = "download.xslt";
+X:include href = "security.xslt";
 X:include href = "versions.xslt";
 
 
--- a/xsls/books.xsls	Thu Oct 11 10:23:05 2012 +0000
+++ b/xsls/books.xsls	Fri Oct 12 09:10:31 2012 +0000
@@ -5,45 +5,6 @@
 
 X:stylesheet {
 
-X:output method="html" version="4.0" 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 LINK = "/article/@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 = "ga.xslt";
-X:include href = "content.xslt";
-
-
-X:template = "/article" {
-    <html><head>
-
-    <title> !{@name} </title>
-
-    !style (lang="@lang")
-
-    !ga ()
-
-    </head>
-
-    !body (lang="@lang")
-
-    </html>
-}
-
-
 X:template = "book" {
 
     <table><tr>
--- a/xsls/download.xsls	Thu Oct 11 10:23:05 2012 +0000
+++ b/xsls/download.xsls	Fri Oct 12 09:10:31 2012 +0000
@@ -5,46 +5,6 @@
 
 X:stylesheet {
 
-X:output method="html" version="4.0" 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 LINK = "/article/@link";
-X:var LANG = "/article/@lang";
-
-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 = "ga.xslt";
-X:include href = "content.xslt";
-
-
-X:template = "/article" {
-    <html><head>
-
-    <title> !{@name} </title>
-
-    !style (lang="@lang")
-
-    !ga ()
-
-    </head>
-
-    !body (lang="@lang")
-
-    </html>
-}
-
-
 X:template = "download" { <table width="100%"> !! "item"; </table> }
 
 
--- a/xsls/error.xsls	Thu Oct 11 10:23:05 2012 +0000
+++ b/xsls/error.xsls	Fri Oct 12 09:10:31 2012 +0000
@@ -5,8 +5,6 @@
 
 X:stylesheet {
 
-X:include href = "ga.xslt";
-
 X:output method="html" version="4.0" indent="no" encoding="utf-8";
 
 X:strip-space elements = "*";
@@ -16,6 +14,15 @@
   -- but not where XSLT processor has been started to run the script
   -->
 X:param XML = "'../xml'";
+X:param YEAR;
+X:param TRANS;
+
+X:var LINK = "/error/@link";
+X:var LANG = "/error/@lang";
+
+X:include href = "dirname.xslt";
+X:include href = "menu.xslt";
+X:include href = "ga.xslt";
 
 
 X:template = "/error" {
@@ -49,14 +56,4 @@
     </html>
 }
 
-
-X:template = "menu/item" {
-    <a href="{@href}"> !{ normalize-space(text()) } </a> <br/>
 }
-
-
-X:template = "menu/item[not(@href)]" {
-    !{ normalize-space(text()) } <br/>
-}
-
-}
--- a/xsls/security.xsls	Thu Oct 11 10:23:05 2012 +0000
+++ b/xsls/security.xsls	Fri Oct 12 09:10:31 2012 +0000
@@ -5,45 +5,6 @@
 
 X:stylesheet {
 
-X:output method="html" version="4.0" 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 LINK = "/article/@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 = "ga.xslt";
-X:include href = "content.xslt";
-
-
-X:template = "/article" {
-    <html><head>
-
-    <title> !{@name} </title>
-
-    !style (lang="@lang")
-
-    !ga ()
-
-    </head>
-
-    !body (lang="@lang")
-
-    </html>
-}
-
-
 X:template = "security" { <ul> !!; </ul> }