1<?xml version='1.0'?> <!--*- mode: xml -*-->
2<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3                version="1.0">
4
5  <!-- import the chunked XSL stylesheet -->
6  <xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl"/>
7  <xsl:include href="version-greater-or-equal.xsl"/>
8
9  <!-- change some parameters -->
10  <xsl:param name="bibliography.collection">bibdatabase.xml</xsl:param>
11  <xsl:param name="bibliography.numbered">1</xsl:param>
12  <xsl:param name="toc.section.depth">0</xsl:param>
13  <xsl:param name="generate.section.toc.level">2</xsl:param>
14  <xsl:param name="generate.toc">
15    book        toc
16    chapter     toc
17    section     toc
18  </xsl:param>
19
20  <xsl:param name="default.encoding" select="'US-ASCII'"/>
21  <xsl:param name="chunker.output.encoding" select="'US-ASCII'"/>
22  <xsl:param name="chunker.output.indent" select="'yes'"/>
23  <xsl:param name="chunk.fast" select="1"/>
24  <xsl:param name="chunk.section.depth" select="0"/>
25  <xsl:param name="chunk.first.sections" select="0"/>
26  <xsl:param name="chapter.autolabel" select="1"/>
27  <xsl:param name="section.autolabel" select="1"/>
28  <xsl:param name="use.id.as.filename" select="1"/>
29  <xsl:param name="html.ext" select="'.html'"/>
30  <xsl:param name="refentry.generate.name" select="0"/>
31  <xsl:param name="refentry.generate.title" select="1"/>
32
33  <!-- use index filtering (if available) -->
34  <xsl:param name="index.on.role" select="1"/>
35
36  <!-- display variablelists as tables -->
37  <xsl:param name="variablelist.as.table" select="1"/>
38
39  <!-- this gets set on the command line ... -->
40  <xsl:param name="gtkdoc.version" select="''"/>
41  <xsl:param name="gtkdoc.bookname" select="''"/>
42
43  <!-- generate consistent IDs so permalinks and bookmarks stay useful when a
44       new igraph version is released -->
45  <xsl:param name="generate.consistent.ids" select="1"/>
46
47  <!-- ========================================================= -->
48  <!-- template to create the index.sgml anchor index -->
49
50  <xsl:template match="book|article">
51    <xsl:variable name="tooldver">
52      <xsl:call-template name="version-greater-or-equal">
53        <xsl:with-param name="ver1" select="$VERSION" />
54        <xsl:with-param name="ver2">1.36</xsl:with-param>
55      </xsl:call-template>
56    </xsl:variable>
57    <xsl:if test="$tooldver = 0">
58      <xsl:message terminate="yes">
59FATAL-ERROR: You need the DocBook XSL Stylesheets version 1.36 or higher
60to build the documentation.
61Get a newer version at http://docbook.sourceforge.net/projects/xsl/
62      </xsl:message>
63    </xsl:if>
64    <xsl:apply-imports/>
65
66  </xsl:template>
67
68  <!-- ========================================================= -->
69  <!-- template to output gtkdoclink elements for the unknown targets -->
70
71  <xsl:template match="link">
72    <xsl:choose>
73      <xsl:when test="id(@linkend)">
74        <xsl:apply-imports/>
75      </xsl:when>
76      <xsl:otherwise>
77        <GTKDOCLINK HREF="{@linkend}">
78          <xsl:apply-templates/>
79        </GTKDOCLINK>
80      </xsl:otherwise>
81    </xsl:choose>
82  </xsl:template>
83
84  <!-- ========================================================= -->
85  <!-- Below are the visual portions of the stylesheet.  They provide
86       the normal gtk-doc output style. -->
87
88  <xsl:param name="shade.verbatim" select="0"/>
89  <xsl:param name="refentry.separator" select="0"/>
90
91  <xsl:template match="refsection">
92    <xsl:if test="preceding-sibling::refsection">
93      <hr/>
94    </xsl:if>
95    <xsl:apply-imports/>
96  </xsl:template>
97
98  <xsl:template name="user.head.content">
99    <script type="text/javascript" src="toggle.js"></script>
100    <xsl:if test="$gtkdoc.version">
101      <meta name="generator"
102            content="GTK-Doc V{$gtkdoc.version} (XML mode)"/>
103    </xsl:if>
104    <link rel="stylesheet" href="style.css" type="text/css"/>
105	<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" type="text/css"/>
106
107      <!-- copied from the html.head template in the docbook stylesheets
108           we don't want links for all refentrys, thats just too much
109        -->
110      <xsl:variable name="this" select="."/>
111      <xsl:for-each select="//part
112                            |//reference
113                            |//preface
114                            |//chapter
115                            |//article
116                            |//appendix[not(parent::article)]|appendix
117                            |//glossary[not(parent::article)]|glossary
118                            |//index[not(parent::article)]|index">
119        <link rel="{local-name(.)}">
120          <xsl:attribute name="href">
121            <xsl:call-template name="href.target">
122              <xsl:with-param name="context" select="$this"/>
123              <xsl:with-param name="object" select="."/>
124            </xsl:call-template>
125          </xsl:attribute>
126          <xsl:attribute name="title">
127            <xsl:apply-templates select="." mode="object.title.markup.textonly"/>
128          </xsl:attribute>
129        </link>
130      </xsl:for-each>
131  </xsl:template>
132
133  <xsl:template match="title" mode="book.titlepage.recto.mode">
134  </xsl:template>
135
136  <xsl:template name="header.navigation">
137    <xsl:param name="prev" select="/foo"/>
138    <xsl:param name="next" select="/foo"/>
139    <xsl:variable name="home" select="/*[1]"/>
140    <xsl:variable name="up" select="parent::*"/>
141
142    <xsl:if test="$suppress.navigation = '0' and $home != .">
143      <div class="navigation-header mb-4" width="100%"
144           summary = "Navigation header">
145        <div class="btn-group">
146          <xsl:if test="count($prev) > 0">
147            <a accesskey="p" class="btn btn-light">
148              <xsl:attribute name="href">
149                <xsl:call-template name="href.target">
150                  <xsl:with-param name="object" select="$prev"/>
151                </xsl:call-template>
152              </xsl:attribute>
153              <i class="fa fa-chevron-left"></i>
154              Previous
155            </a>
156          </xsl:if>
157          <xsl:if test="count($up) > 0 and $up != $home">
158            <a accesskey="u" class="btn btn-light">
159              <xsl:attribute name="href">
160                <xsl:call-template name="href.target">
161                  <xsl:with-param name="object" select="$up"/>
162                </xsl:call-template>
163              </xsl:attribute>
164              <i class="fa fa-chevron-up"></i>
165              Up
166            </a>
167          </xsl:if>
168          <xsl:if test="$home != .">
169            <a accesskey="h" class="btn btn-light">
170              <xsl:attribute name="href">
171                <xsl:call-template name="href.target">
172                  <xsl:with-param name="object" select="$home"/>
173                </xsl:call-template>
174              </xsl:attribute>
175              <i class="fa fa-home"></i>
176              Home
177            </a>
178          </xsl:if>
179          <xsl:if test="count($next) > 0">
180            <a accesskey="n" class="btn btn-light">
181              <xsl:attribute name="href">
182                <xsl:call-template name="href.target">
183                  <xsl:with-param name="object" select="$next"/>
184                </xsl:call-template>
185              </xsl:attribute>
186              <i class="fa fa-chevron-right"></i>
187              Next
188            </a>
189          </xsl:if>
190        </div>
191      </div>
192    </xsl:if>
193  </xsl:template>
194
195  <xsl:template name="footer.navigation">
196    <xsl:param name="prev" select="/foo"/>
197    <xsl:param name="next" select="/foo"/>
198
199    <xsl:if test="$suppress.navigation = '0'">
200      <table class="navigation-footer" width="100%"
201             summary="Navigation footer" cellpadding="2" cellspacing="0">
202        <tr valign="middle">
203          <td align="left">
204            <xsl:if test="count($prev) > 0">
205              <a accesskey="p">
206                <xsl:attribute name="href">
207                  <xsl:call-template name="href.target">
208                    <xsl:with-param name="object" select="$prev"/>
209                  </xsl:call-template>
210                </xsl:attribute>
211                <b>
212                  <xsl:text>&#8592;&#160;</xsl:text>
213                  <xsl:apply-templates select="$prev"
214                                       mode="object.title.markup"/>
215                </b>
216              </a>
217            </xsl:if>
218          </td>
219          <td align="right">
220            <xsl:if test="count($next) > 0">
221              <a accesskey="n">
222                <xsl:attribute name="href">
223                  <xsl:call-template name="href.target">
224                    <xsl:with-param name="object" select="$next"/>
225                  </xsl:call-template>
226                </xsl:attribute>
227                <b>
228                  <xsl:apply-templates select="$next"
229                                       mode="object.title.markup"/>
230                  <xsl:text>&#160;&#8594;</xsl:text>
231                </b>
232              </a>
233            </xsl:if>
234          </td>
235        </tr>
236      </table>
237    </xsl:if>
238  </xsl:template>
239
240  <xsl:template name="user.footer.content">
241  </xsl:template>
242
243  <!-- avoid creating multiple identical indices
244       if the stylesheets don't support filtered indices
245    -->
246  <xsl:template match="index">
247    <xsl:variable name="has-filtered-index">
248      <xsl:call-template name="version-greater-or-equal">
249        <xsl:with-param name="ver1" select="$VERSION" />
250        <xsl:with-param name="ver2">1.66</xsl:with-param>
251      </xsl:call-template>
252    </xsl:variable>
253    <xsl:if test="($has-filtered-index = 1) or (count(@role) = 0)">
254      <xsl:apply-imports/>
255    </xsl:if>
256  </xsl:template>
257
258  <xsl:template match="index" mode="toc">
259    <xsl:variable name="has-filtered-index">
260      <xsl:call-template name="version-greater-or-equal">
261        <xsl:with-param name="ver1" select="$VERSION" />
262        <xsl:with-param name="ver2">1.66</xsl:with-param>
263      </xsl:call-template>
264    </xsl:variable>
265    <xsl:if test="($has-filtered-index = 1) or (count(@role) = 0)">
266      <xsl:apply-imports/>
267    </xsl:if>
268  </xsl:template>
269
270  <xsl:template match="para">
271    <xsl:choose>
272      <xsl:when test="@role = 'gallery'">
273         <div class="container">
274           <div class="gallery-spacer"> </div>
275           <xsl:apply-templates mode="gallery.mode"/>
276         <div class="gallery-spacer"> </div>
277         </div>
278      </xsl:when>
279      <xsl:otherwise>
280        <xsl:apply-imports/>
281      </xsl:otherwise>
282    </xsl:choose>
283  </xsl:template>
284
285  <xsl:template match="link" mode="gallery.mode">
286    <div class="gallery-float">
287       <xsl:apply-templates select="."/>
288    </div>
289  </xsl:template>
290
291  <!-- add gallery handling to refnamediv template -->
292  <xsl:template match="refnamediv">
293    <div class="{name(.)}">
294      <table width="100%">
295        <tr><td valign="top">
296         <xsl:call-template name="anchor"/>
297           <xsl:choose>
298             <xsl:when test="$refentry.generate.name != 0">
299               <h2>
300                <xsl:call-template name="gentext">
301                  <xsl:with-param name="key" select="'RefName'"/>
302                </xsl:call-template>
303              </h2>
304            </xsl:when>
305            <xsl:when test="$refentry.generate.title != 0">
306              <h2>
307                <xsl:choose>
308                  <xsl:when test="../refmeta/refentrytitle">
309                    <xsl:apply-templates select="../refmeta/refentrytitle"/>
310                  </xsl:when>
311                  <xsl:otherwise>
312                    <xsl:apply-templates select="refname[1]"/>
313                  </xsl:otherwise>
314                </xsl:choose>
315              </h2>
316            </xsl:when>
317          </xsl:choose>
318          <p>
319            <xsl:apply-templates/>
320          </p>
321        </td>
322        <td valign="top" align="right">
323           <!-- find the gallery image to use here
324                - determine the id of the enclosing refentry
325                - look for an inlinegraphic inside a link with linkend == refentryid inside a para with role == gallery
326                - use it here
327             -->
328           <xsl:variable name="refentryid" select="../@id"/>
329           <xsl:apply-templates select="//para[@role = 'gallery']/link[@linkend = $refentryid]/inlinegraphic"/>
330        </td></tr>
331       </table>
332     </div>
333  </xsl:template>
334
335  <xsl:template match="example">
336    <xsl:variable name="id" select="@id"/>
337    <div class="hideshow" onClick="toggle(this, event)">
338      <xsl:apply-imports />
339    </div>
340  </xsl:template>
341
342</xsl:stylesheet>
343