# HG changeset patch # User Maxim Dounin # Date 1400693847 -14400 # Node ID 333eccb8a7f6648e412ebeb22e9958f967a5dff1 # Parent 5ee8a00f2bc59fdedba3cc9f88954d2387ad0f0d Moved dir.map postprocessing into template. diff -r 5ee8a00f2bc5 -r 333eccb8a7f6 GNUmakefile --- a/GNUmakefile Tue May 20 14:41:05 2014 +0400 +++ b/GNUmakefile Wed May 21 21:37:27 2014 +0400 @@ -288,9 +288,7 @@ dir.map: xslt/dirmap.xslt xml/en/docs/dirindex.xml \ xml/en/docs/varindex.xml @xsltproc -o - xslt/dirmap.xslt xml/en/docs/dirindex.xml \ - xml/en/docs/varindex.xml | \ - sed 's/^ *//;/^$$/d;s/^var_/$$/' | \ - sort -u -k1,1 | sed 's/^include /\\&/' > $@ + xml/en/docs/varindex.xml > $@ ifeq ($(patsubst %.nginx.org,YES,$(shell hostname)), YES) all: dir.map diff -r 5ee8a00f2bc5 -r 333eccb8a7f6 xsls/dirmap.xsls --- a/xsls/dirmap.xsls Tue May 20 14:41:05 2014 +0400 +++ b/xsls/dirmap.xsls Wed May 21 21:37:27 2014 +0400 @@ -6,6 +6,8 @@ X:output method="text"; +X:strip-space elements="*"; + X:template = "link" { !{@id} X:text{ } @@ -15,4 +17,32 @@ X:text{; } } +X:template = "link[@id = 'include']" { + X:text{\\} + !{@id} + X:text{ } + !{substring-before(@doc, '.xml')} + X:text{.html#} + !{@id} + X:text{; } } + +X:template = "link[starts-with(@id, 'var_')]" { + X:text{$} + !{substring-after(@id, 'var_')} + X:text{ } + !{substring-before(@doc, '.xml')} + X:text{.html#} + !{@id} + X:text{; } +} + +X:template = "links | varlinks" { + X:for-each "link", X:sort "@id" { + X:if "count(preceding-sibling::link[@id = current()/@id]) = 0" { + !! "."; + } + } +} + +}