Skip to content

Commit 400d0b8

Browse files
committed
Improve pdf icon style
1 parent 6b39c68 commit 400d0b8

File tree

3 files changed

+27
-14
lines changed

3 files changed

+27
-14
lines changed

src/doc/common/static/custom-furo.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,13 @@ body[data-theme="dark"] div.highlight {
1111
background: #383838;
1212
}
1313

14+
/* Copied the style for a.pdf from website/templates/index_furo.html */
15+
16+
a.pdf {
17+
margin-right: 0.5em;
18+
}
19+
20+
a.pdf:hover {
21+
text-decoration: none;
22+
}
23+

src/doc/en/website/templates/index_furo.html

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@
1010
border: none;
1111
}
1212
a.pdf {
13-
margin-left: 0.5em;
14-
{%- if hide_pdf_links %}
13+
margin-right: 0.3em;
14+
{%- if hide_pdf_links %}
1515
display: none;
16-
{%- endif %}
16+
{%- endif %}
17+
}
18+
a.pdf:hover {
19+
text-decoration: none;
1720
}
1821
table.contentstable {
1922
align: center;
@@ -41,7 +44,7 @@ <h2>
4144
<tr valign="top">
4245
<td width="50%">
4346
<p class="biglink">
44-
<a title="Download PDF" class="pdf" href="../../pdf/en/a_tour_of_sage/a_tour_of_sage.pdf">
47+
<a title="PDF" class="pdf" href="../../pdf/en/a_tour_of_sage/a_tour_of_sage.pdf">
4548
<img class="icon" src="_static/pdf.png"></img>
4649
</a>
4750
<a class="biglink" href="a_tour_of_sage/index.html">
@@ -55,7 +58,7 @@ <h2>
5558
</td>
5659
<td width="50%">
5760
<p class="biglink">
58-
<a title="Download PDF" class="pdf" href="../../pdf/en/prep/prep_tutorials.pdf">
61+
<a title="PDF" class="pdf" href="../../pdf/en/prep/prep_tutorials.pdf">
5962
<img class="icon" src="_static/pdf.png"></img>
6063
</a>
6164
<a class="biglink" href="prep/index.html">
@@ -75,7 +78,7 @@ <h2>
7578
<tr valign="top">
7679
<td width="50%">
7780
<p class="biglink">
78-
<a title="Download PDF" class="pdf" href="../../pdf/en/tutorial/sage_tutorial.pdf">
81+
<a title="PDF" class="pdf" href="../../pdf/en/tutorial/sage_tutorial.pdf">
7982
<img class="icon" src="_static/pdf.png"></img>
8083
</a>
8184
<a class="biglink" href="tutorial/index.html">
@@ -90,7 +93,7 @@ <h2>
9093
</td>
9194
<td width="50%">
9295
<p class="biglink">
93-
<a title="Download PDF" class="pdf" href="../../pdf/en/constructions/constructions.pdf">
96+
<a title="PDF" class="pdf" href="../../pdf/en/constructions/constructions.pdf">
9497
<img class="icon" src="_static/pdf.png"></img>
9598
</a>
9699
<a class="biglink" href="constructions/index.html">
@@ -108,7 +111,7 @@ <h2>
108111
<tr valign="top">
109112
<td width="50%">
110113
<p class="biglink">
111-
<a title="Download PDF" class="pdf" href="../../pdf/en/thematic_tutorials/thematic_tutorials.pdf">
114+
<a title="PDF" class="pdf" href="../../pdf/en/thematic_tutorials/thematic_tutorials.pdf">
112115
<img class="icon" src="_static/pdf.png"></img>
113116
</a>
114117
<a class="biglink" href="thematic_tutorials/index.html">
@@ -128,7 +131,7 @@ <h2>
128131
</td>
129132
<td width="50%">
130133
<p class="biglink">
131-
<a title="Download PDF" class="pdf" href="../../pdf/en/faq/faq.pdf">
134+
<a title="PDF" class="pdf" href="../../pdf/en/faq/faq.pdf">
132135
<img class="icon" src="_static/pdf.png"></img>
133136
</a>
134137
<a class="biglink" href="faq/index.html">
@@ -153,7 +156,7 @@ <h2>
153156
<tr valign="top">
154157
<td width="50%">
155158
<p class="biglink">
156-
<a title="Link to PDF" class="pdf" href="reference/index-pdf.html">
159+
<a title="PDF" class="pdf" href="reference/index-pdf.html">
157160
<img class="icon" src="_static/pdf.png"></img>
158161
</a>
159162
<a class="biglink" href="reference/index.html">
@@ -184,7 +187,7 @@ <h2>
184187
<tr valign="top">
185188
<td width="50%">
186189
<p class="biglink">
187-
<a title="Download PDF" class="pdf" href="../../pdf/en/installation/installation.pdf">
190+
<a title="PDF" class="pdf" href="../../pdf/en/installation/installation.pdf">
188191
<img class="icon" src="_static/pdf.png"></img>
189192
</a>
190193
<a class="biglink" href="installation/index.html">
@@ -201,7 +204,7 @@ <h2>
201204
</td>
202205
<td width="50%">
203206
<p class="biglink">
204-
<a title="Download PDF" class="pdf" href="../../pdf/en/developer/developer.pdf">
207+
<a title="PDF" class="pdf" href="../../pdf/en/developer/developer.pdf">
205208
<img class="icon" src="_static/pdf.png"></img>
206209
</a>
207210
<a class="biglink" href="developer/index.html">

src/sage_docbuild/builders.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -720,14 +720,14 @@ def pdf(self):
720720
#
721721
# Change the third form to
722722
#
723-
# <a href="module/module.pdf">blah <img src="_static/pdf.png" /></a>
723+
# <a href="module/module.pdf"><img src="_static/pdf.png">blah</a>
724724
#
725725
rst = re.sub(r'`([^`\n]*)`__.*\n\n__ (.*)',
726726
r'<a href="\2">\1</a>.', rst)
727727
rst = re.sub(r'`([^<\n]*)\s+<(.*)>`_',
728728
r'<a href="\2">\1</a>', rst)
729729
rst = re.sub(r':doc:`([^<]*?)\s+<(.*)/index>`',
730-
r'<a href="../../../pdf/en/reference/\2/\2.pdf"><img src="_static/pdf.png"/></a>&nbsp;<a href="\2/index.html">\1</a> ', rst)
730+
r'<a title="PDF" class="pdf" href="../../../pdf/en/reference/\2/\2.pdf"><img src="_static/pdf.png"></a><a href="\2/index.html">\1</a> ', rst)
731731
# Body: add paragraph <p> markup.
732732
start = rst.rfind('*\n') + 1
733733
end = rst.find('\nUser Interfaces')

0 commit comments

Comments
 (0)