Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb0f0a94

Browse files
committed
Make documentation builds reproducible
Currently, the documentation builds are not fully reproducible (in thesense ofhttps://reproducible-builds.org/). A fix is availableupstream (docbook/xslt10-stylesheets#54) butnot released. This commit patches the upstream fix into ourcustomization layer.This patch addresses both the HTML and the FO output. The man outputis already reproducible.Discussion:https://www.postgresql.org/message-id/flat/9077b779-a9f8-09c8-6e85-da1ebfba15af@eisentraut.org
1 parent2bcf078 commitb0f0a94

File tree

2 files changed

+493
-0
lines changed

2 files changed

+493
-0
lines changed

‎doc/src/sgml/stylesheet-fo.xsl

Lines changed: 259 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
<?xml version="1.0" encoding="utf-8"?>
2+
<!DOCTYPExsl:stylesheet [
3+
<!ENTITY %common.entities SYSTEM"http://docbook.sourceforge.net/release/xsl/current/common/entities.ent">
4+
%common.entities;
5+
]>
26
<xsl:stylesheetxmlns:xsl="http://www.w3.org/1999/XSL/Transform"
37
version="1.0"
48
xmlns:fo="http://www.w3.org/1999/XSL/Format">
@@ -138,4 +142,259 @@
138142
</fo:bookmark>
139143
</xsl:template>
140144

145+
<!-- make generated ids reproducible
146+
(https://github.com/docbook/xslt10-stylesheets/issues/54)-->
147+
148+
<!-- from fo/autoidx.xsl-->
149+
150+
<xsl:templatematch="indexterm"mode="index-primary">
151+
<xsl:paramname="scope"select="."/>
152+
<xsl:paramname="role"select="''"/>
153+
<xsl:paramname="type"select="''"/>
154+
155+
<xsl:variablename="key"select="&primary;"/>
156+
<xsl:variablename="refs"select="key('primary', $key)[&scope;]"/>
157+
158+
<xsl:variablename="term.separator">
159+
<xsl:call-templatename="index.separator">
160+
<xsl:with-paramname="key"select="'index.term.separator'"/>
161+
</xsl:call-template>
162+
</xsl:variable>
163+
164+
<xsl:variablename="range.separator">
165+
<xsl:call-templatename="index.separator">
166+
<xsl:with-paramname="key"select="'index.range.separator'"/>
167+
</xsl:call-template>
168+
</xsl:variable>
169+
170+
<xsl:variablename="number.separator">
171+
<xsl:call-templatename="index.separator">
172+
<xsl:with-paramname="key"select="'index.number.separator'"/>
173+
</xsl:call-template>
174+
</xsl:variable>
175+
176+
<fo:blockxmlns:rx="http://www.renderx.com/XSL/Extensions"xmlns:axf="http://www.antennahouse.com/names/XSL/Extensions">
177+
<xsl:iftest="$autolink.index.see != 0">
178+
<xsl:attributename="id">
179+
<!-- pgsql-docs: begin-->
180+
<xsl:text>ientry-</xsl:text>
181+
<xsl:call-templatename="object.id"/>
182+
<!-- pgsql-docs: end-->
183+
</xsl:attribute>
184+
</xsl:if>
185+
<xsl:iftest="$axf.extensions != 0">
186+
<xsl:attributename="axf:suppress-duplicate-page-number">true</xsl:attribute>
187+
</xsl:if>
188+
189+
<xsl:for-eachselect="$refs/primary">
190+
<xsl:iftest="@id or @xml:id">
191+
<fo:inlineid="{(@id|@xml:id)[1]}"/>
192+
</xsl:if>
193+
</xsl:for-each>
194+
195+
<xsl:value-ofselect="primary"/>
196+
197+
<xsl:choose>
198+
<xsl:whentest="$xep.extensions != 0">
199+
<xsl:iftest="$refs[not(see) and not(secondary)]">
200+
<xsl:copy-ofselect="$term.separator"/>
201+
<xsl:variablename="primary"select="&primary;"/>
202+
<xsl:variablename="primary.significant"select="concat(&primary;, $significant.flag)"/>
203+
<rx:page-indexlist-separator="{$number.separator}"
204+
range-separator="{$range.separator}">
205+
<xsl:iftest="$refs[@significance='preferred'][not(see) and not(secondary)]">
206+
<rx:index-itemxsl:use-attribute-sets="index.preferred.page.properties xep.index.item.properties"
207+
ref-key="{$primary.significant}"/>
208+
</xsl:if>
209+
<xsl:iftest="$refs[not(@significance) or @significance!='preferred'][not(see) and not(secondary)]">
210+
<rx:index-itemxsl:use-attribute-sets="xep.index.item.properties"
211+
ref-key="{$primary}"/>
212+
</xsl:if>
213+
</rx:page-index>
214+
</xsl:if>
215+
</xsl:when>
216+
<xsl:otherwise>
217+
<xsl:variablename="page-number-citations">
218+
<xsl:for-eachselect="$refs[not(see)
219+
and not(secondary)]">
220+
<xsl:apply-templatesselect="."mode="reference">
221+
<xsl:with-paramname="scope"select="$scope"/>
222+
<xsl:with-paramname="role"select="$role"/>
223+
<xsl:with-paramname="type"select="$type"/>
224+
<xsl:with-paramname="position"select="position()"/>
225+
</xsl:apply-templates>
226+
</xsl:for-each>
227+
</xsl:variable>
228+
229+
<xsl:copy-ofselect="$page-number-citations"/>
230+
</xsl:otherwise>
231+
</xsl:choose>
232+
233+
<xsl:iftest="$refs[not(secondary)]/*[self::see]">
234+
<xsl:apply-templatesselect="$refs[generate-id() = generate-id(key('see', concat(&primary;,&sep;,&sep;,&sep;, see))[&scope;][1])]"
235+
mode="index-see">
236+
<xsl:with-paramname="scope"select="$scope"/>
237+
<xsl:with-paramname="role"select="$role"/>
238+
<xsl:with-paramname="type"select="$type"/>
239+
<xsl:sortselect="translate(see,&lowercase;,&uppercase;)"/>
240+
</xsl:apply-templates>
241+
</xsl:if>
242+
243+
</fo:block>
244+
245+
<xsl:iftest="$refs/secondary or $refs[not(secondary)]/*[self::seealso]">
246+
<fo:blockstart-indent="1pc">
247+
<xsl:apply-templatesselect="$refs[generate-id() = generate-id(key('see-also', concat(&primary;,&sep;,&sep;,&sep;, seealso))[&scope;][1])]"
248+
mode="index-seealso">
249+
<xsl:with-paramname="scope"select="$scope"/>
250+
<xsl:with-paramname="role"select="$role"/>
251+
<xsl:with-paramname="type"select="$type"/>
252+
<xsl:sortselect="translate(seealso,&lowercase;,&uppercase;)"/>
253+
</xsl:apply-templates>
254+
<xsl:apply-templatesselect="$refs[secondary and count(.|key('secondary', concat($key,&sep;,&secondary;))[&scope;][1]) = 1]"
255+
mode="index-secondary">
256+
<xsl:with-paramname="scope"select="$scope"/>
257+
<xsl:with-paramname="role"select="$role"/>
258+
<xsl:with-paramname="type"select="$type"/>
259+
<xsl:sortselect="translate(&secondary;,&lowercase;,&uppercase;)"/>
260+
</xsl:apply-templates>
261+
</fo:block>
262+
</xsl:if>
263+
</xsl:template>
264+
265+
<xsl:templatematch="indexterm"mode="index-see">
266+
<xsl:paramname="scope"select="."/>
267+
<xsl:paramname="role"select="''"/>
268+
<xsl:paramname="type"select="''"/>
269+
270+
<xsl:variablename="see"select="normalize-space(see)"/>
271+
272+
<!-- can only link to primary, which should appear before comma
273+
in see "primary, secondary" entry-->
274+
<xsl:variablename="seeprimary">
275+
<xsl:choose>
276+
<xsl:whentest="contains($see, ',')">
277+
<xsl:value-ofselect="substring-before($see, ',')"/>
278+
</xsl:when>
279+
<xsl:otherwise>
280+
<xsl:value-ofselect="$see"/>
281+
</xsl:otherwise>
282+
</xsl:choose>
283+
</xsl:variable>
284+
285+
<xsl:variablename="seetarget"select="key('primaryonly', $seeprimary)[1]"/>
286+
287+
<xsl:variablename="linkend">
288+
<xsl:iftest="$seetarget">
289+
<!-- pgsql-docs: begin-->
290+
<xsl:text>ientry-</xsl:text>
291+
<xsl:call-templatename="object.id">
292+
<xsl:with-paramname="object"select="$seetarget"/>
293+
</xsl:call-template>
294+
<!-- pgsql-docs: end-->
295+
</xsl:if>
296+
</xsl:variable>
297+
298+
<fo:inlinexmlns:xlink='http://www.w3.org/1999/xlink'>
299+
<xsl:text> (</xsl:text>
300+
<xsl:call-templatename="gentext">
301+
<xsl:with-paramname="key"select="'see'"/>
302+
</xsl:call-template>
303+
<xsl:text> </xsl:text>
304+
<xsl:choose>
305+
<!-- manual links have precedence-->
306+
<xsl:whentest="see/@linkend or see/@xlink:href">
307+
<xsl:call-templatename="simple.xlink">
308+
<xsl:with-paramname="node"select="see"/>
309+
<xsl:with-paramname="content"select="$see"/>
310+
</xsl:call-template>
311+
</xsl:when>
312+
<xsl:whentest="$autolink.index.see = 0">
313+
<xsl:value-ofselect="$see"/>
314+
</xsl:when>
315+
<xsl:whentest="$seetarget">
316+
<fo:basic-linkinternal-destination="{$linkend}"
317+
xsl:use-attribute-sets="xref.properties">
318+
<xsl:value-ofselect="$see"/>
319+
</fo:basic-link>
320+
</xsl:when>
321+
<xsl:otherwise>
322+
<xsl:value-ofselect="$see"/>
323+
</xsl:otherwise>
324+
</xsl:choose>
325+
<xsl:text>)</xsl:text>
326+
</fo:inline>
327+
</xsl:template>
328+
329+
<xsl:templatematch="indexterm"mode="index-seealso">
330+
<xsl:paramname="scope"select="."/>
331+
<xsl:paramname="role"select="''"/>
332+
<xsl:paramname="type"select="''"/>
333+
334+
<xsl:for-eachselect="seealso">
335+
<xsl:sortselect="translate(.,&lowercase;,&uppercase;)"/>
336+
337+
<xsl:variablename="seealso"select="normalize-space(.)"/>
338+
339+
<!-- can only link to primary, which should appear before comma
340+
in seealso "primary, secondary" entry-->
341+
<xsl:variablename="seealsoprimary">
342+
<xsl:choose>
343+
<xsl:whentest="contains($seealso, ',')">
344+
<xsl:value-ofselect="substring-before($seealso, ',')"/>
345+
</xsl:when>
346+
<xsl:otherwise>
347+
<xsl:value-ofselect="$seealso"/>
348+
</xsl:otherwise>
349+
</xsl:choose>
350+
</xsl:variable>
351+
352+
<xsl:variablename="seealsotarget"select="key('primaryonly', $seealsoprimary)[1]"/>
353+
354+
<xsl:variablename="linkend">
355+
<xsl:iftest="$seealsotarget">
356+
<!-- pgsql-docs: begin-->
357+
<xsl:text>ientry-</xsl:text>
358+
<xsl:call-templatename="object.id">
359+
<xsl:with-paramname="object"select="$seealsotarget"/>
360+
</xsl:call-template>
361+
<!-- pgsql-docs: end-->
362+
</xsl:if>
363+
</xsl:variable>
364+
365+
<fo:blockxmlns:xlink='http://www.w3.org/1999/xlink'>
366+
<xsl:text>(</xsl:text>
367+
<xsl:call-templatename="gentext">
368+
<xsl:with-paramname="key"select="'seealso'"/>
369+
</xsl:call-template>
370+
<xsl:text> </xsl:text>
371+
<xsl:choose>
372+
<!-- manual links have precedence-->
373+
<xsl:whentest="@linkend or see/@xlink:href">
374+
<xsl:call-templatename="simple.xlink">
375+
<xsl:with-paramname="node"select="."/>
376+
<xsl:with-paramname="content"select="$seealso"/>
377+
</xsl:call-template>
378+
</xsl:when>
379+
<xsl:whentest="$autolink.index.see = 0">
380+
<xsl:value-ofselect="$seealso"/>
381+
</xsl:when>
382+
<xsl:whentest="$seealsotarget">
383+
<fo:basic-linkinternal-destination="{$linkend}"
384+
xsl:use-attribute-sets="xref.properties">
385+
<xsl:value-ofselect="$seealso"/>
386+
</fo:basic-link>
387+
</xsl:when>
388+
<xsl:otherwise>
389+
<xsl:value-ofselect="$seealso"/>
390+
</xsl:otherwise>
391+
</xsl:choose>
392+
<xsl:text>)</xsl:text>
393+
</fo:block>
394+
395+
</xsl:for-each>
396+
397+
</xsl:template>
398+
399+
141400
</xsl:stylesheet>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp