Add 'php/phpxmlrpc/' from commit 'cd5dbb4a511e7a616a61187a5de1a611a9748cbd'
[plcapi.git] / php / phpxmlrpc / doc / build / custom.fo.xsl
1 <?xml version='1.0'?>
2 <xsl:stylesheet
3     xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
4     xmlns:fo="http://www.w3.org/1999/XSL/Format">
5 <!--
6  Customization xsl stylesheet for docbook to pdf transform
7  @author Gaetano Giunta
8  @copyright (c) 2007-2015 G. Giunta
9  @license code licensed under the BSD License
10  @todo make the xsl more dynamic: the path to import docbook.xsl could be f.e. rewritten/injected by the php user
11 -->
12
13
14 <!-- import base stylesheet -->
15 <xsl:import href="../../../../vendor/docbook/docbook-xsl/fo/docbook.xsl"/>
16
17
18 <!-- customization vars -->
19 <xsl:param name="fop1.extensions">1</xsl:param>
20 <xsl:param name="draft.mode">no</xsl:param>
21 <xsl:param name="funcsynopsis.style">ansi</xsl:param>
22 <xsl:param name="id.warnings">0</xsl:param>
23 <xsl:param name="highlight.source">1</xsl:param>
24 <xsl:param name="highlight.default.language">php</xsl:param>
25 <xsl:param name="paper.type">A4</xsl:param>
26 <xsl:param name="shade.verbatim">1</xsl:param>
27
28 <xsl:attribute-set name="verbatim.properties">
29   <xsl:attribute name="font-size">80%</xsl:attribute>
30 </xsl:attribute-set>
31
32
33 <!-- elements added / modified -->
34 <xsl:template match="funcdef/function">
35   <xsl:choose>
36     <xsl:when test="$funcsynopsis.decoration != 0">
37       <fo:inline font-weight="bold">
38         <xsl:apply-templates/>
39       </fo:inline>
40     </xsl:when>
41     <xsl:otherwise>
42       <xsl:apply-templates/>
43     </xsl:otherwise>
44   </xsl:choose>
45   <xsl:text> </xsl:text>
46 </xsl:template>
47
48 <xsl:template match="funcdef/type">
49   <xsl:apply-templates/>
50   <xsl:text> </xsl:text>
51 </xsl:template>
52
53 <xsl:template match="void">
54   <xsl:choose>
55     <xsl:when test="$funcsynopsis.style='ansi'">
56       <xsl:text>( void )</xsl:text>
57     </xsl:when>
58     <xsl:otherwise>
59       <xsl:text>( )</xsl:text>
60     </xsl:otherwise>
61   </xsl:choose>
62 </xsl:template>
63
64 <xsl:template match="varargs">
65   <xsl:text>( ... )</xsl:text>
66 </xsl:template>
67
68 <xsl:template match="paramdef">
69   <xsl:variable name="paramnum">
70     <xsl:number count="paramdef" format="1"/>
71   </xsl:variable>
72   <xsl:if test="$paramnum=1">( </xsl:if>
73   <xsl:choose>
74     <xsl:when test="$funcsynopsis.style='ansi'">
75       <xsl:apply-templates/>
76     </xsl:when>
77     <xsl:otherwise>
78       <xsl:apply-templates select="./parameter"/>
79     </xsl:otherwise>
80   </xsl:choose>
81   <xsl:choose>
82     <xsl:when test="following-sibling::paramdef">
83       <xsl:text>, </xsl:text>
84     </xsl:when>
85     <xsl:otherwise>
86       <xsl:text> )</xsl:text>
87     </xsl:otherwise>
88   </xsl:choose>
89 </xsl:template>
90
91 <xsl:template match="paramdef/type">
92   <xsl:apply-templates/>
93   <xsl:text> </xsl:text>
94 </xsl:template>
95
96 <!-- default values for function parameters -->
97 <xsl:template match="paramdef/initializer">
98   <xsl:text> = </xsl:text>
99   <xsl:apply-templates/>
100 </xsl:template>
101
102
103 </xsl:stylesheet>