Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
b7e9326b
Commit
b7e9326b
authored
May 26, 2013
by
Davis King
Browse files
Updated stylesheet to support listing of python example programs.
parent
1e7703d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
10 deletions
+48
-10
docs/docs/stylesheet.xsl
docs/docs/stylesheet.xsl
+48
-10
No files found.
docs/docs/stylesheet.xsl
View file @
b7e9326b
...
@@ -603,17 +603,55 @@ function BigToggle(node)
...
@@ -603,17 +603,55 @@ function BigToggle(node)
</xsl:for-each>
</xsl:for-each>
</xsl:template>
</xsl:template>
<!-- This template outputs a length 1 string if there is a python example program -->
<xsl:template
name=
"has_python_example"
>
<xsl:for-each
select=
"example"
>
<xsl:if
test=
"substring-before(.,'.py.html') != ''"
>
1
</xsl:if>
</xsl:for-each>
</xsl:template>
<!-- This template outputs a length 1 string if there is a C++ example program -->
<xsl:template
name=
"has_cpp_example"
>
<xsl:for-each
select=
"example"
>
<xsl:if
test=
"substring-before(.,'.cpp.html') != ''"
>
1
</xsl:if>
</xsl:for-each>
</xsl:template>
<xsl:template
match=
"examples"
>
<xsl:template
match=
"examples"
>
<BR/>
Example Programs:
<xsl:variable
name=
"has_python"
><xsl:call-template
name=
"has_python_example"
/></xsl:variable>
<xsl:variable
name=
"has_cpp"
><xsl:call-template
name=
"has_cpp_example"
/></xsl:variable>
<xsl:variable
name=
"numpy"
select=
"string-length($has_python)"
/>
<xsl:variable
name=
"numcpp"
select=
"string-length($has_cpp)"
/>
<xsl:if
test=
"$numcpp != 0"
>
<BR/>
C++ Example Programs:
</xsl:if>
<xsl:for-each
select=
"example"
>
<xsl:for-each
select=
"example"
>
<xsl:choose>
<xsl:variable
name=
"fname"
select=
"substring-before(.,'.cpp.html')"
/>
<xsl:when
test=
"position() = last()"
>
<xsl:variable
name=
"name"
select=
"substring-before(.,'.html')"
/>
<a
href=
"{.}"
><xsl:value-of
select=
"substring-before(.,'.html')"
/></a>
<xsl:if
test=
"$fname != ''"
>
</xsl:when>
<xsl:choose>
<xsl:otherwise>
<xsl:when
test=
"position() >= last()-$numpy"
>
<a
href=
"{.}"
><xsl:value-of
select=
"substring-before(.,'.html')"
/></a>
,
<a
href=
"{.}"
><xsl:value-of
select=
"$name"
/></a>
</xsl:otherwise>
</xsl:when>
</xsl:choose>
<xsl:otherwise>
<a
href=
"{.}"
><xsl:value-of
select=
"$name"
/></a>
,
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:for-each>
<xsl:if
test=
"$numpy != 0"
>
<BR/>
Python Example Programs:
</xsl:if>
<xsl:for-each
select=
"example"
>
<xsl:variable
name=
"fname"
select=
"substring-before(.,'.py.html')"
/>
<xsl:variable
name=
"name"
select=
"substring-before(.,'.html')"
/>
<xsl:if
test=
"$fname != ''"
>
<xsl:choose>
<xsl:when
test=
"position() >= last()-$numcpp"
>
<a
href=
"{.}"
><xsl:value-of
select=
"$name"
/></a>
</xsl:when>
<xsl:otherwise>
<a
href=
"{.}"
><xsl:value-of
select=
"$name"
/></a>
,
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</xsl:template>
</xsl:template>
...
@@ -1081,7 +1119,7 @@ function BigToggle(node)
...
@@ -1081,7 +1119,7 @@ function BigToggle(node)
<!-- ************************************************************************* -->
<!-- ************************************************************************* -->
<!-- ************************************************************************* -->
<!-- ************************************************************************* -->
<!-- ******* Subversion stylesheet st
f
uff ******************** -->
<!-- ******* Subversion stylesheet stuff ******************** -->
<!-- ************************************************************************* -->
<!-- ************************************************************************* -->
<!-- ************************************************************************* -->
<!-- ************************************************************************* -->
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment