Skip to content

Commit ae27b1c

Browse files
committed
Review comments
1 parent cef8b44 commit ae27b1c

5 files changed

Lines changed: 44 additions & 42 deletions

File tree

doc/_ext/colordot.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
extensions = [..., "colordot"]
1414
"""
1515

16+
import html
1617
from typing import Any
1718

1819
from docutils import nodes
@@ -43,9 +44,9 @@ def colordot_role( # pylint: disable=too-many-arguments,too-many-positional-arg
4344
Returns:
4445
A two-tuple of (node list, system message list) as required by Sphinx.
4546
"""
46-
color = text.strip()
47-
html = f'<span class="dg-dot" style="background:{color};"></span>'
48-
node = nodes.raw("", html, format="html")
47+
color = html.escape(text.strip(), quote=True)
48+
markup = f'<span class="dg-dot" style="background:{color};"></span>'
49+
node = nodes.raw("", markup, format="html")
4950
return [node], []
5051

5152

doc/_ext/designguide.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
extensions = [..., "designguide"]
2525
"""
2626

27+
import html
2728
from typing import Any
2829

2930
from docutils import nodes
@@ -51,17 +52,17 @@ def run(self) -> list[Node]:
5152
Returns:
5253
A list containing a single raw HTML node.
5354
"""
54-
color = self.arguments[0].strip()
55-
token = self.options.get("token", "")
56-
label = self.options.get("label", "")
57-
usage = self.options.get("usage", "")
58-
border = self.options.get("border", "")
55+
color = html.escape(self.arguments[0].strip(), quote=True)
56+
token = html.escape(self.options.get("token", ""))
57+
label = html.escape(self.options.get("label", ""))
58+
usage = html.escape(self.options.get("usage", ""))
59+
border = html.escape(self.options.get("border", ""), quote=True)
5960

6061
color_style = f"background:{color};"
6162
if border:
6263
color_style += f" border-bottom:1px solid {border};"
6364

64-
html = (
65+
markup = (
6566
f'<div class="dg-swatch">'
6667
f'<div class="dg-swatch-color" style="{color_style}"></div>'
6768
f'<div class="dg-swatch-body">'
@@ -72,7 +73,7 @@ def run(self) -> list[Node]:
7273
f"</div>"
7374
f"</div>"
7475
)
75-
return [nodes.raw("", html, format="html")]
76+
return [nodes.raw("", markup, format="html")]
7677

7778

7879
class PaletteDirective(Directive):

doc/_templates/about.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
<nav class="sidebar-quicklinks" aria-label="Quick links">
2-
<a href="{{ pathto(master_doc) }}" title="Documentation home">
2+
<a href="{{ pathto(master_doc) }}" title="Documentation home" aria-label="Documentation home">
33
<i class="fa-solid fa-house" aria-hidden="true"></i>
44
</a>
5-
<a href="https://dfetch-org.github.io/" title="Dfetch website" target="_blank" rel="noopener noreferrer">
5+
<a href="https://dfetch-org.github.io/" title="Dfetch website" aria-label="Dfetch website" target="_blank" rel="noopener noreferrer">
66
<i class="fa-solid fa-globe" aria-hidden="true"></i>
77
</a>
8-
<a href="https://github.com/dfetch-org/dfetch" title="Source on GitHub" target="_blank" rel="noopener noreferrer">
8+
<a href="https://github.com/dfetch-org/dfetch" title="Source on GitHub" aria-label="Source on GitHub" target="_blank" rel="noopener noreferrer">
99
<i class="fa-brands fa-github" aria-hidden="true"></i>
1010
</a>
1111
</nav>

doc/landing-page/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ readable files inside your own repository. You stay in full control of every lin
394394
``dfetch import`` automatically converts **Git submodules and SVN externals** into a dfetch manifest.
395395
No manual work, no lost history — start benefiting from dfetch's workflow immediately.
396396

397-
.. button-link:: https://dfetch.rtfd.io/en/latest/migration.html
397+
.. button-link:: https://dfetch.rtfd.io/en/latest/howto/migration.html
398398
:color: primary
399399
:shadow:
400400

doc/static/css/custom.css

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ html, body {
5656
}
5757

5858
body {
59-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
59+
font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
6060
font-size: 16px;
6161
-webkit-font-smoothing: antialiased;
6262
-moz-osx-font-smoothing: grayscale;
@@ -93,7 +93,7 @@ div.body {
9393
Typography
9494
============================================================ */
9595
h1, h2, h3, h4, h5, h6 {
96-
font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif !important;
96+
font-family: Inter, -apple-system, BlinkMacSystemFont, sans-serif !important;
9797
font-weight: 700 !important;
9898
letter-spacing: -0.02em;
9999
line-height: 1.25 !important;
@@ -107,7 +107,7 @@ h3 { font-size: 1.2rem !important; margin-top: 2rem !important; }
107107
.body p,
108108
.body dd,
109109
.body li {
110-
font-family: "Inter", sans-serif;
110+
font-family: Inter, sans-serif;
111111
font-size: 1.0625rem;
112112
font-weight: 400;
113113
line-height: 1.8;
@@ -185,7 +185,7 @@ div.admonition {
185185
border-radius: var(--r-sm) !important;
186186
border-left: 4px solid var(--accent) !important;
187187
box-shadow: var(--shad-sm) !important;
188-
font-family: "Inter", sans-serif;
188+
font-family: Inter, sans-serif;
189189
padding: 1.25rem 1.5rem !important;
190190
background: var(--bg-mint) !important;
191191
transition: box-shadow var(--ease) !important;
@@ -211,7 +211,7 @@ div.admonition.hint {
211211
}
212212

213213
div.admonition p.admonition-title {
214-
font-family: "Inter", sans-serif;
214+
font-family: Inter, sans-serif;
215215
font-weight: 700 !important;
216216
color: var(--accent) !important;
217217
margin: 0 0 0.5rem 0 !important;
@@ -310,7 +310,7 @@ div.admonition p {
310310
}
311311

312312
.sd-card-title {
313-
font-family: "Inter", sans-serif !important;
313+
font-family: Inter, sans-serif !important;
314314
font-size: 1.0625rem !important;
315315
font-weight: 700 !important;
316316
color: var(--text) !important;
@@ -373,7 +373,7 @@ table.docutils tbody tr td {
373373

374374
table.docutils thead tr th,
375375
table.docutils thead tr th p {
376-
font-family: "Inter", sans-serif;
376+
font-family: Inter, sans-serif;
377377
font-size: 0.7rem !important;
378378
font-weight: 700 !important;
379379
letter-spacing: 0.06em !important;
@@ -389,7 +389,7 @@ table.docutils tbody tr td {
389389
vertical-align: middle !important;
390390
background: #fff !important;
391391
color: var(--text) !important;
392-
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
392+
font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
393393
font-size: 0.8rem !important;
394394
-webkit-font-smoothing: antialiased;
395395
}
@@ -421,7 +421,7 @@ table.docutils thead tr th code {
421421
Sidebar
422422
============================================================ */
423423
.sphinxsidebar .caption-text {
424-
font-family: "Inter", sans-serif;
424+
font-family: Inter, sans-serif;
425425
font-size: 0.75rem;
426426
font-weight: 700;
427427
letter-spacing: 0.08em;
@@ -476,7 +476,7 @@ nav.sidebar-quicklinks a:hover {
476476

477477
.sphinxsidebarwrapper .internal,
478478
.sphinxsidebarwrapper .external {
479-
font-family: "Inter", sans-serif;
479+
font-family: Inter, sans-serif;
480480
font-weight: 400;
481481
font-size: 0.9rem;
482482
}
@@ -496,7 +496,7 @@ nav.sidebar-quicklinks a:hover {
496496
}
497497

498498
.sphinxsidebar input[type="text"] {
499-
font-family: "Inter", sans-serif;
499+
font-family: Inter, sans-serif;
500500
border: 1px solid var(--border);
501501
border-radius: var(--r-sm);
502502
padding: 0.35rem 0.6rem;
@@ -512,7 +512,7 @@ nav.sidebar-quicklinks a:hover {
512512
}
513513

514514
.sphinxsidebar input[type="submit"] {
515-
font-family: "Inter", sans-serif;
515+
font-family: Inter, sans-serif;
516516
background: var(--primary);
517517
color: #fff;
518518
border: none;
@@ -539,7 +539,7 @@ nav.sidebar-quicklinks a:hover {
539539
}
540540

541541
.caption-text {
542-
font-family: "Inter", sans-serif !important;
542+
font-family: Inter, sans-serif !important;
543543
font-weight: 700 !important;
544544
font-size: 0.75rem !important;
545545
letter-spacing: 0.08em;
@@ -646,15 +646,15 @@ hr {
646646

647647
/* Field lists (option tables) */
648648
table.field-list th {
649-
font-family: "Inter", sans-serif;
649+
font-family: Inter, sans-serif;
650650
font-weight: 600;
651651
color: var(--text-muted);
652652
font-size: 0.875rem;
653653
}
654654

655655
/* Sphinx "rubric" headings */
656656
p.rubric {
657-
font-family: "Inter", sans-serif !important;
657+
font-family: Inter, sans-serif !important;
658658
font-weight: 700 !important;
659659
font-size: 0.9rem !important;
660660
letter-spacing: 0.06em;
@@ -682,7 +682,7 @@ body.dxt-explanation h1::after { background: var(--dxt-explanation); }
682682

683683
/* Sphinx tabs — match palette */
684684
.sphinx-tabs-tab {
685-
font-family: "Inter", sans-serif !important;
685+
font-family: Inter, sans-serif !important;
686686
font-weight: 500 !important;
687687
}
688688

@@ -749,7 +749,7 @@ body.dxt-explanation h1::after { background: var(--dxt-explanation); }
749749
}
750750

751751
.cs-masthead-title {
752-
font-family: "Inter", sans-serif;
752+
font-family: Inter, sans-serif;
753753
font-size: 0.9375rem;
754754
font-weight: 700;
755755
color: #f0e8dc;
@@ -758,7 +758,7 @@ body.dxt-explanation h1::after { background: var(--dxt-explanation); }
758758
}
759759

760760
.cs-masthead-tagline {
761-
font-family: "Inter", sans-serif;
761+
font-family: Inter, sans-serif;
762762
font-size: 0.7rem;
763763
color: rgba(240, 232, 220, 0.45);
764764
margin-top: 0.1rem;
@@ -832,7 +832,7 @@ body.dxt-explanation h1::after { background: var(--dxt-explanation); }
832832
gap: 0.5rem;
833833
padding: 0.35rem 0;
834834
margin-bottom: 0.2rem;
835-
font-family: "Inter", sans-serif;
835+
font-family: Inter, sans-serif;
836836
font-size: 0.65rem;
837837
font-weight: 700;
838838
letter-spacing: 0.1em;
@@ -909,7 +909,7 @@ body.dxt-explanation h1::after { background: var(--dxt-explanation); }
909909
.cs-ag { color: #9b8e85; } /* <arg> / [opt] — muted */
910910

911911
.cs-dsc {
912-
font-family: "Inter", sans-serif;
912+
font-family: Inter, sans-serif;
913913
font-size: 0.75rem;
914914
color: rgba(240, 232, 220, 0.52);
915915
line-height: 1.45;
@@ -932,7 +932,7 @@ body.dxt-explanation h1::after { background: var(--dxt-explanation); }
932932
padding: 0.6rem 1.5rem;
933933
background: rgba(0, 0, 0, 0.25);
934934
border-top: 1px solid rgba(255, 255, 255, 0.06);
935-
font-family: "Inter", sans-serif;
935+
font-family: Inter, sans-serif;
936936
font-size: 0.6875rem;
937937
color: rgba(240, 232, 220, 0.3);
938938
text-align: center;
@@ -1143,15 +1143,15 @@ body.dxt-explanation h1::after { background: var(--dxt-explanation); }
11431143
}
11441144

11451145
.dg-swatch-label {
1146-
font-family: "Inter", sans-serif;
1146+
font-family: Inter, sans-serif;
11471147
font-size: 0.7rem;
11481148
font-weight: 600;
11491149
color: var(--text);
11501150
margin-bottom: 0.1rem;
11511151
}
11521152

11531153
.dg-swatch-usage {
1154-
font-family: "Inter", sans-serif;
1154+
font-family: Inter, sans-serif;
11551155
font-size: 0.675rem;
11561156
color: var(--text-muted);
11571157
line-height: 1.4;
@@ -1186,7 +1186,7 @@ body.dxt-explanation h1::after { background: var(--dxt-explanation); }
11861186
}
11871187

11881188
.dg-type-name {
1189-
font-family: "Inter", sans-serif;
1189+
font-family: Inter, sans-serif;
11901190
font-size: 0.7rem;
11911191
font-weight: 700;
11921192
text-transform: uppercase;
@@ -1206,7 +1206,7 @@ body.dxt-explanation h1::after { background: var(--dxt-explanation); }
12061206
}
12071207

12081208
.dg-type-specimen {
1209-
font-family: "Inter", sans-serif;
1209+
font-family: Inter, sans-serif;
12101210
margin: 0;
12111211
line-height: 1.4;
12121212
}
@@ -1240,7 +1240,7 @@ body.dxt-explanation h1::after { background: var(--dxt-explanation); }
12401240
}
12411241

12421242
.dg-weight-sample {
1243-
font-family: "Inter", sans-serif;
1243+
font-family: Inter, sans-serif;
12441244
font-size: 0.9rem;
12451245
color: var(--text);
12461246
line-height: 1;
@@ -1261,7 +1261,7 @@ body.dxt-explanation h1::after { background: var(--dxt-explanation); }
12611261
.dg-tokens th {
12621262
background: var(--bg-tint) !important;
12631263
color: var(--text) !important;
1264-
font-family: "Inter", sans-serif !important;
1264+
font-family: Inter, sans-serif !important;
12651265
font-size: 0.7rem !important;
12661266
font-weight: 700 !important;
12671267
text-transform: uppercase !important;
@@ -1319,7 +1319,7 @@ body.dxt-explanation div.body { border-top: 4px solid var(--dxt-explanation); }
13191319
display: inline-block;
13201320
padding: 0.2rem 0.65rem;
13211321
border-radius: 20px;
1322-
font-family: "Inter", sans-serif;
1322+
font-family: Inter, sans-serif;
13231323
font-size: 0.675rem;
13241324
font-weight: 600;
13251325
letter-spacing: 0.04em;

0 commit comments

Comments
 (0)