]> git.evergreen-ils.org Git - working/Evergreen.git/blob - stylesheets/evergreen_docbook_files/docbook-xsl-1.75.2/tools/make/Makefile.docParam
Add stylesheets for our evergreen docbook site.
[working/Evergreen.git] / stylesheets / evergreen_docbook_files / docbook-xsl-1.75.2 / tools / make / Makefile.docParam
1 # $Source$
2 # $Author: xmldoc $
3 # $Date: 2007-03-23 14:57:22 -0700 (Fri, 23 Mar 2007) $
4 # $Revision: 6759 $
5 # vim: number
6 #
7 # ------------------------------------------------------------------
8 #  ** Makefile.paramDoc - create param.xsl files w/ embedded doc **
9 # ------------------------------------------------------------------
10
11 PARAMFILES = $(wildcard ../../*/param.xsl)
12 PARAMFILESDOCD = $(foreach base,$(basename $(PARAMFILES)),$(base).docd.xsl)
13
14 XSLT=xsltproc
15 XSLTFLAGS=
16
17 COPYDOC := <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" \
18                 xmlns:doc="http://docbook.org/ns/docbook" \
19                 version="1.0"> \
20   <xsl:template match="*[local-name() = &apos;param&apos;]"> \
21     <xsl:call-template name="copy-xsl-source"/> \
22   </xsl:template> \
23   <xsl:template match="*[local-name() = &apos;attribute-set&apos;]"> \
24     <xsl:call-template name="copy-xsl-source"/> \
25   </xsl:template> \
26   <xsl:template name="copy-xsl-source"> \
27     <xsl:variable \
28         name="source" \
29         select="concat(&apos;../../params/&apos;,@name,&apos;.xml&apos;)"/> \
30     <xsl:apply-templates select="document($$source)/*[local-name() = &apos;refentry&apos;]"/> \
31     <xsl:copy> \
32       <xsl:apply-templates select="@* | node()"/> \
33     </xsl:copy> \
34   </xsl:template> \
35   <xsl:template match="node() | @*"> \
36     <xsl:copy> \
37       <xsl:apply-templates select="@* | node()"/> \
38     </xsl:copy> \
39   </xsl:template> \
40   <xsl:template match="*[local-name() = &apos;refentry&apos;]"> \
41     <xsl:text>&\#x0a;</xsl:text> \
42     <doc:refentry id="{@*[local-name() = &apos;id&apos;]}"> \
43       <xsl:apply-templates/> \
44     </doc:refentry> \
45     <xsl:text>&\#x0a;</xsl:text> \
46   </xsl:template> \
47   <xsl:template match="*[local-name() = &apos;refsynopsisdiv&apos;]"/> \
48 </xsl:stylesheet>
49
50 all: $(PARAMFILESDOCD)
51
52 %.docd.xsl: %.xsl
53         @echo '$(COPYDOC)' | $(XSLT) $(XSLTFLAGS) - $< > $@
54
55 debug:
56         @echo $(PARAMFILESDOCD)
57
58 clean:
59         $(RM) $(PARAMFILESDOCD)