Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
97f16b87
Commit
97f16b87
authored
8 years ago
by
Peter Eisentraut
Browse files
Options
Downloads
Patches
Plain Diff
doc: Add index letter links to XSLT HTML build
This matches what was already implemented in the DSSSL HTML build.
parent
1f87181e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
doc/src/sgml/stylesheet.xsl
+187
-0
187 additions, 0 deletions
doc/src/sgml/stylesheet.xsl
with
187 additions
and
0 deletions
doc/src/sgml/stylesheet.xsl
+
187
−
0
View file @
97f16b87
<?xml version='1.0'?>
<?xml version='1.0'?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY % common.entities SYSTEM "http://docbook.sourceforge.net/release/xsl/current/common/entities.ent">
%common.entities;
]>
<xsl:stylesheet
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
<xsl:stylesheet
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
version=
'1.0'
version=
'1.0'
xmlns=
"http://www.w3.org/TR/xhtml1/transitional"
xmlns=
"http://www.w3.org/TR/xhtml1/transitional"
...
@@ -59,4 +63,187 @@ section toc
...
@@ -59,4 +63,187 @@ section toc
set toc,title
set toc,title
</xsl:param>
</xsl:param>
<!-- Put index "quicklinks" (A | B | C | ...) at the top of the bookindex page. -->
<!-- from html/autoidx.xsl -->
<xsl:template
name=
"generate-basic-index"
>
<xsl:param
name=
"scope"
select=
"NOTANODE"
/>
<xsl:variable
name=
"role"
>
<xsl:if
test=
"$index.on.role != 0"
>
<xsl:value-of
select=
"@role"
/>
</xsl:if>
</xsl:variable>
<xsl:variable
name=
"type"
>
<xsl:if
test=
"$index.on.type != 0"
>
<xsl:value-of
select=
"@type"
/>
</xsl:if>
</xsl:variable>
<xsl:variable
name=
"terms"
select=
"//indexterm
[count(.|key('letter',
translate(substring(&primary;, 1, 1),
&lowercase;,
&uppercase;))
[&scope;][1]) = 1
and not(@class = 'endofrange')]"
/>
<xsl:variable
name=
"alphabetical"
select=
"$terms[contains(concat(&lowercase;, &uppercase;),
substring(&primary;, 1, 1))]"
/>
<xsl:variable
name=
"others"
select=
"$terms[not(contains(concat(&lowercase;,
&uppercase;),
substring(&primary;, 1, 1)))]"
/>
<div
class=
"index"
>
<!-- pgsql-docs: begin added stuff -->
<p
class=
"indexdiv-quicklinks"
>
<a
href=
"#indexdiv-Symbols"
>
<xsl:call-template
name=
"gentext"
>
<xsl:with-param
name=
"key"
select=
"'index symbols'"
/>
</xsl:call-template>
</a>
<xsl:apply-templates
select=
"$alphabetical[count(.|key('letter',
translate(substring(&primary;, 1, 1),
&lowercase;,&uppercase;))[&scope;][1]) = 1]"
mode=
"index-div-quicklinks"
>
<xsl:with-param
name=
"position"
select=
"position()"
/>
<xsl:with-param
name=
"scope"
select=
"$scope"
/>
<xsl:with-param
name=
"role"
select=
"$role"
/>
<xsl:with-param
name=
"type"
select=
"$type"
/>
<xsl:sort
select=
"translate(&primary;, &lowercase;, &uppercase;)"
/>
</xsl:apply-templates>
</p>
<!-- pgsql-docs: end added stuff -->
<xsl:if
test=
"$others"
>
<xsl:choose>
<xsl:when
test=
"normalize-space($type) != '' and
$others[@type = $type][count(.|key('primary', &primary;)[&scope;][1]) = 1]"
>
<!-- pgsql-docs: added id attribute here for linking to it -->
<div
class=
"indexdiv"
id=
"indexdiv-Symbols"
>
<h3>
<xsl:call-template
name=
"gentext"
>
<xsl:with-param
name=
"key"
select=
"'index symbols'"
/>
</xsl:call-template>
</h3>
<dl>
<xsl:apply-templates
select=
"$others[count(.|key('primary', &primary;)[&scope;][1]) = 1]"
mode=
"index-symbol-div"
>
<xsl:with-param
name=
"position"
select=
"position()"
/>
<xsl:with-param
name=
"scope"
select=
"$scope"
/>
<xsl:with-param
name=
"role"
select=
"$role"
/>
<xsl:with-param
name=
"type"
select=
"$type"
/>
<xsl:sort
select=
"translate(&primary;, &lowercase;, &uppercase;)"
/>
</xsl:apply-templates>
</dl>
</div>
</xsl:when>
<xsl:when
test=
"normalize-space($type) != ''"
>
<!-- Output nothing, as there isn't a match for $other using this $type -->
</xsl:when>
<xsl:otherwise>
<!-- pgsql-docs: added id attribute here for linking to it -->
<div
class=
"indexdiv"
id=
"indexdiv-Symbols"
>
<h3>
<xsl:call-template
name=
"gentext"
>
<xsl:with-param
name=
"key"
select=
"'index symbols'"
/>
</xsl:call-template>
</h3>
<dl>
<xsl:apply-templates
select=
"$others[count(.|key('primary',
&primary;)[&scope;][1]) = 1]"
mode=
"index-symbol-div"
>
<xsl:with-param
name=
"position"
select=
"position()"
/>
<xsl:with-param
name=
"scope"
select=
"$scope"
/>
<xsl:with-param
name=
"role"
select=
"$role"
/>
<xsl:with-param
name=
"type"
select=
"$type"
/>
<xsl:sort
select=
"translate(&primary;, &lowercase;, &uppercase;)"
/>
</xsl:apply-templates>
</dl>
</div>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:apply-templates
select=
"$alphabetical[count(.|key('letter',
translate(substring(&primary;, 1, 1),
&lowercase;,&uppercase;))[&scope;][1]) = 1]"
mode=
"index-div-basic"
>
<xsl:with-param
name=
"position"
select=
"position()"
/>
<xsl:with-param
name=
"scope"
select=
"$scope"
/>
<xsl:with-param
name=
"role"
select=
"$role"
/>
<xsl:with-param
name=
"type"
select=
"$type"
/>
<xsl:sort
select=
"translate(&primary;, &lowercase;, &uppercase;)"
/>
</xsl:apply-templates>
</div>
</xsl:template>
<xsl:template
match=
"indexterm"
mode=
"index-div-basic"
>
<xsl:param
name=
"scope"
select=
"."
/>
<xsl:param
name=
"role"
select=
"''"
/>
<xsl:param
name=
"type"
select=
"''"
/>
<xsl:variable
name=
"key"
select=
"translate(substring(&primary;, 1, 1),
&lowercase;,&uppercase;)"
/>
<xsl:if
test=
"key('letter', $key)[&scope;]
[count(.|key('primary', &primary;)[&scope;][1]) = 1]"
>
<div
class=
"indexdiv"
>
<!-- pgsql-docs: added id attribute here for linking to it -->
<xsl:attribute
name=
"id"
>
<xsl:value-of
select=
"concat('indexdiv-', $key)"
/>
</xsl:attribute>
<xsl:if
test=
"contains(concat(&lowercase;, &uppercase;), $key)"
>
<h3>
<xsl:value-of
select=
"translate($key, &lowercase;, &uppercase;)"
/>
</h3>
</xsl:if>
<dl>
<xsl:apply-templates
select=
"key('letter', $key)[&scope;]
[count(.|key('primary', &primary;)
[&scope;][1])=1]"
mode=
"index-primary"
>
<xsl:with-param
name=
"position"
select=
"position()"
/>
<xsl:with-param
name=
"scope"
select=
"$scope"
/>
<xsl:with-param
name=
"role"
select=
"$role"
/>
<xsl:with-param
name=
"type"
select=
"$type"
/>
<xsl:sort
select=
"translate(&primary;, &lowercase;, &uppercase;)"
/>
</xsl:apply-templates>
</dl>
</div>
</xsl:if>
</xsl:template>
<!-- pgsql-docs -->
<xsl:template
match=
"indexterm"
mode=
"index-div-quicklinks"
>
<xsl:param
name=
"scope"
select=
"."
/>
<xsl:param
name=
"role"
select=
"''"
/>
<xsl:param
name=
"type"
select=
"''"
/>
<xsl:variable
name=
"key"
select=
"translate(substring(&primary;, 1, 1),
&lowercase;,&uppercase;)"
/>
<xsl:if
test=
"key('letter', $key)[&scope;]
[count(.|key('primary', &primary;)[&scope;][1]) = 1]"
>
<xsl:if
test=
"contains(concat(&lowercase;, &uppercase;), $key)"
>
|
<a>
<xsl:attribute
name=
"href"
>
<xsl:value-of
select=
"concat('#indexdiv-', $key)"
/>
</xsl:attribute>
<xsl:value-of
select=
"translate($key, &lowercase;, &uppercase;)"
/>
</a>
</xsl:if>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
</xsl:stylesheet>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment