Skip to content

Commit 1919ec2

Browse files
committed
Correct the support for xref page with CSS
1 parent 5e95601 commit 1919ec2

File tree

7 files changed

+175
-275
lines changed

7 files changed

+175
-275
lines changed

src/guide/xml/ch02.xml

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,7 @@ xrefstyle="%c"/>.</para>
10861086

10871087
<informaltable frame="all">
10881088
<tgroup cols="3" rowsep="1" colsep="1">
1089-
<colspec colname="c1" colwidth="2*" rowsep="1"/>
1089+
<colspec colname="c1" colwidth="1*" rowsep="1"/>
10901090
<colspec colname="c2" colwidth="1*" rowsep="1"/>
10911091
<colspec colname="c3" colwidth="2*" rowsep="1"/>
10921092

@@ -1122,10 +1122,7 @@ xrefstyle="%c"/>.</para>
11221122
<row>
11231123
<entry><code>%p</code></entry>
11241124
<entry><phrase outputformat="print"><xref linkend="syntax-highlighting" xrefstyle="%p"/></phrase></entry>
1125-
<entry>Page number. Intended for print output (PDF). Displayed as <emphasis>"#"</emphasis> in HTML,
1126-
unless you differentiate between the output formats for print and online. See <xref
1127-
linkend="using-pagenumber-in-crossreferences" xrefstyle="%label"/> for a possible
1128-
solution.</entry>
1125+
<entry>Page number in print output (PDF). Not displayed in HTML.</entry>
11291126
</row>
11301127
<row>
11311128
<entry><code>%label (%c)</code></entry>
@@ -1149,7 +1146,7 @@ xrefstyle="%c"/>.</para>
11491146

11501147
<informaltable frame="all">
11511148
<tgroup cols="3" colsep="1" rowsep="1">
1152-
<colspec colname="c1" colwidth="2*" rowsep="1"/>
1149+
<colspec colname="c1" colwidth="1*" rowsep="1"/>
11531150
<colspec colname="c2" colwidth="1*" rowsep="1"/>
11541151
<colspec colname="c3" colwidth="2*" rowsep="1"/>
11551152

@@ -1177,36 +1174,6 @@ xrefstyle="%c"/>.</para>
11771174
</tbody>
11781175
</tgroup>
11791176
</informaltable>
1180-
1181-
<section xml:id="using-pagenumber-in-crossreferences">
1182-
<title>Using pagenumber in cross-references</title>
1183-
<para>The <code>%p</code> makes little sense in HTML output, since there are no page numbers.
1184-
If you use it anyway, it will be displayed as <emphasis>"#"</emphasis>, which can be
1185-
confusing for readers. A possible solution for this problem is the use of the
1186-
<code>outputformat</code> attribute, that was intoduced in <xref linkend="profiling"/> and
1187-
<xref linkend="table.effectivity-attributes" xrefstyle="%label"/><phrase
1188-
outputformat="print"> on page <xref linkend="table.effectivity-attributes" xrefstyle="%p"
1189-
/></phrase>.</para>
1190-
1191-
<para><emphasis>This</emphasis> cross reference to <xref linkend="syntax-highlighting"
1192-
xrefstyle="%label"/>
1193-
<phrase outputformat="print"> on <xref linkend="syntax-highlighting" xrefstyle="page %p"
1194-
/></phrase> will include the target`s page number only when the
1195-
<code>@profile.outputformat</code> parameter is <emphasis>"print"</emphasis>, but without
1196-
the annoying <emphasis>#</emphasis> in HTML.</para>
1197-
1198-
<example>
1199-
<title>Use outputformat to deal with page numbers in cross references</title>
1200-
<programlisting>This cross reference to
1201-
&lt;xref linkend=&quot;syntax-highlighting&quot; xrefstyle="%label/&gt;
1202-
&lt;phrase outputformat=&quot;print&quot;&gt;
1203-
on &lt;xref linkend=&quot;syntax-highlighting&quot; xrefstyle=&quot;page %p&quot;/&gt;
1204-
&lt;/phrase&gt;
1205-
will reference the page number only when the
1206-
@profile.outputformat parameter is print, but
1207-
without the annoying # in HTML.</programlisting>
1208-
</example>
1209-
</section>
12101177
</section>
12111178

12121179
<section xml:id="syntax-highlighting">

src/main/scss/media-all.scss

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -359,11 +359,6 @@ a.pmuj {
359359
font-style: italic;
360360
}
361361

362-
.xref-pagenum {
363-
content: target-counter(attr(href), page);
364-
font-style:normal;
365-
}
366-
367362
.xref-area,
368363
.xref-areaset,
369364
.xref-co,

src/main/scss/media-paged.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,3 +211,10 @@ span.footnote p {
211211
padding-top: 0;
212212
margin-top: 0;
213213
}
214+
215+
/* xref with pagenumber ====================================== */
216+
217+
.xref-pagenum::after {
218+
content: target-counter(attr(href), page);
219+
font-style:normal;
220+
}

src/main/scss/media-screen.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,4 +478,4 @@ nav.top div {
478478
nav.bottom table .next {
479479
padding-right: 1rem;
480480
}
481-
}
481+
}

src/main/xslt/modules/links.xsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@
245245
group-adjacent=". instance of node() and local-name() = ('pagenum')">
246246
<xsl:choose>
247247
<xsl:when test="boolean(current-grouping-key())">
248-
<a href="#{f:id($target)}" class="xref xref-{local-name($target)} xref-{local-name(.)}">#</a>
248+
<a href="#{f:id($target)}" class="xref xref-{local-name($target)} xref-{local-name(.)}"/>
249249
</xsl:when>
250250
<xsl:otherwise>
251251
<a href="#{f:id($target)}" class="xref xref-{local-name($target)}">

0 commit comments

Comments
 (0)