Skip to content

Commit e4a654b

Browse files
authored
Use 'cite' elements for bibliography entries and links (#2016)
1 parent 392e7a1 commit e4a654b

File tree

404 files changed

+26402
-26399
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

404 files changed

+26402
-26399
lines changed

bikeshed/biblio.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,11 @@ def toHTML(self):
9696
ret.append(str)
9797

9898
if self.url:
99-
ret.append(E.a({"href": self.url}, self.title))
99+
ret.append(E.a({"href": self.url}, E.cite(self.title)))
100100
ret.append(". ")
101101
else:
102-
ret.append(self.title + ". ")
102+
ret.append(E.cite(self.title))
103+
ret.append(". ")
103104

104105
str = ""
105106
if self.preferredURL == "current" and self.current_url:

bikeshed/boilerplate.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ def addIndexOfLocallyDefinedTerms(doc, container):
349349
for linkText in linkTexts:
350350
entry = {
351351
"url": "#" + id,
352-
"label": "§" + headingLevel,
352+
"label": \u202f" + headingLevel,
353353
"disambiguator": disambiguator,
354354
}
355355
indexEntries[linkText].append(entry)

bikeshed/boilerplate/stylesheet.include

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* - .toc for the Table of Contents (<ol class="toc">)
88
* + <span class="secno"> for the section numbers
99
* - #toc for the Table of Contents (<nav id="toc">)
10-
* - ul.index for Indices (<a href="#ref">term</a><span>, in §N.M</span>)
10+
* - ul.index for Indices (<a href="#ref">term</a><span>, in §N.M</span>)
1111
* - table.index for Index Tables (e.g. for properties or elements)
1212
*
1313
* Structural Markup

bikeshed/unsortedJunk.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,8 @@ def fillInterDocumentReferenceFromShepherd(doc, el, spec, section):
553553
el.tag = "a"
554554
el.set("href", heading["url"])
555555
if isEmpty(el):
556-
el.text = "{spec} §{number} {text}".format(**heading)
556+
appendChild(el, E.cite("{spec}".format(**heading)))
557+
appendChild(el, " §\u202f{number} {text}".format(**heading))
557558
removeAttr(el, "data-link-spec", "spec-section")
558559

559560

@@ -569,7 +570,7 @@ def fillInterDocumentReferenceFromSpecref(doc, el, spec, section):
569570
el.tag = "a"
570571
el.set("href", bib.url + section)
571572
if isEmpty(el):
572-
el.text = bib.title + " §" + section[1:]
573+
el.text = bib.title + " §\u202f" + section[1:]
573574
removeAttr(el, "data-link-spec", "spec-section")
574575

575576

@@ -939,7 +940,8 @@ def processBiblioLinks(doc):
939940
if (
940941
el.text == f"[{linkText}]"
941942
): # False if it's already been replaced by an author supplied text using the [[FOOBAR inline|custom text]] syntax.
942-
replaceContents(el, ref.title)
943+
clearContents(el)
944+
appendChild(el, E.cite(ref.title))
943945
if ref.url is not None:
944946
el.set("href", ref.url)
945947

tests/adjacent-boilerplate/adjacent-boilerplate.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -505,9 +505,9 @@ <h2 class="no-num no-ref heading settled" id="references"><span class="content">
505505
<h3 class="no-num no-ref heading settled" id="normative"><span class="content">Normative References</span></h3>
506506
<dl>
507507
<dt id="biblio-example-spec">[EXAMPLE-SPEC]
508-
<dd>bar; baz. <a href="https://example.test/foo/">Foo Level 1</a>. REC. URL: <a href="https://example.test/foo/">https://example.test/foo/</a>
508+
<dd>bar; baz. <a href="https://example.test/foo/"><cite>Foo Level 1</cite></a>. REC. URL: <a href="https://example.test/foo/">https://example.test/foo/</a>
509509
<dt id="biblio-fetch">[FETCH]
510-
<dd>Anne van Kesteren. <a href="https://fetch.spec.whatwg.org/">Fetch Standard</a>. Living Standard. URL: <a href="https://fetch.spec.whatwg.org/">https://fetch.spec.whatwg.org/</a>
510+
<dd>Anne van Kesteren. <a href="https://fetch.spec.whatwg.org/"><cite>Fetch Standard</cite></a>. Living Standard. URL: <a href="https://fetch.spec.whatwg.org/">https://fetch.spec.whatwg.org/</a>
511511
</dl>
512512
<script>/* script-dfn-panel */
513513

tests/algorithm001.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -455,9 +455,9 @@ <h2 class="heading settled" data-level="2" id="foo2"><span class="secno">2. </sp
455455
<h2 class="no-num no-ref heading settled" id="index"><span class="content">Index</span><a class="self-link" href="#index"></a></h2>
456456
<h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="content">Terms defined by this specification</span><a class="self-link" href="#index-defined-here"></a></h3>
457457
<ul class="index">
458-
<li><a href="#find-even-more-foo">find even more foo</a><span>, in §2</span>
459-
<li><a href="#find-more-foo">find more foo</a><span>, in §2</span>
460-
<li><a href="#find-some-bar">find some bar</a><span>, in §2</span>
458+
<li><a href="#find-even-more-foo">find even more foo</a><span>, in §2</span>
459+
<li><a href="#find-more-foo">find more foo</a><span>, in §2</span>
460+
<li><a href="#find-some-bar">find some bar</a><span>, in §2</span>
461461
</ul>
462462
<script>/* script-var-click-highlighting */
463463

tests/biblio001.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -437,16 +437,16 @@ <h2 class="no-num no-ref heading settled" id="references"><span class="content">
437437
<h3 class="no-num no-ref heading settled" id="normative"><span class="content">Normative References</span></h3>
438438
<dl>
439439
<dt id="biblio-normative">[NORMATIVE]
440-
<dd>alice; bob. <a href="https://example.test/bar/">Bar Level 1</a>. REC. URL: <a href="https://example.test/bar/">https://example.test/bar/</a>
440+
<dd>alice; bob. <a href="https://example.test/bar/"><cite>Bar Level 1</cite></a>. REC. URL: <a href="https://example.test/bar/">https://example.test/bar/</a>
441441
</dl>
442442
<h3 class="no-num no-ref heading settled" id="informative"><span class="content">Informative References</span></h3>
443443
<dl>
444444
<dt id="biblio-alias-of-something-else">[ALIAS-OF-SOMETHING-ELSE]
445445
<dd>I'm something else string-based.
446446
<dt id="biblio-no-author">[NO-AUTHOR]
447-
<dd><a href="https://example.test/baz/">Baz Level 1</a>. REC. URL: <a href="https://example.test/baz/">https://example.test/baz/</a>
447+
<dd><a href="https://example.test/baz/"><cite>Baz Level 1</cite></a>. REC. URL: <a href="https://example.test/baz/">https://example.test/baz/</a>
448448
<dt id="biblio-non-normative">[NON-NORMATIVE]
449-
<dd>bar; baz. <a href="https://example.test/foo/">Foo Level 1</a>. REC. URL: <a href="https://example.test/foo/">https://example.test/foo/</a>
449+
<dd>bar; baz. <a href="https://example.test/foo/"><cite>Foo Level 1</cite></a>. REC. URL: <a href="https://example.test/foo/">https://example.test/foo/</a>
450450
<dt id="biblio-string-based">[STRING-BASED]
451451
<dd>I'm made out of unstructured text, oh no!
452452
</dl>

tests/biblio002.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -421,12 +421,12 @@ <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
421421
</nav>
422422
<main>
423423
<p><a data-link-type="biblio" href="#biblio-rfc2119">[RFC2119]</a></p>
424-
<p><a data-biblio-display="inline" data-link-type="biblio" href="https://datatracker.ietf.org/doc/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a></p>
424+
<p><a data-biblio-display="inline" data-link-type="biblio" href="https://datatracker.ietf.org/doc/html/rfc2119"><cite>Key words for use in RFCs to Indicate Requirement Levels</cite></a></p>
425425
<p><a data-biblio-display="index" data-link-type="biblio" href="#biblio-rfc2119">[RFC2119]</a></p>
426426
</main>
427427
<h2 class="no-num no-ref heading settled" id="references"><span class="content">References</span></h2>
428428
<h3 class="no-num no-ref heading settled" id="informative"><span class="content">Informative References</span></h3>
429429
<dl>
430430
<dt id="biblio-rfc2119">[RFC2119]
431-
<dd>S. Bradner. <a href="https://datatracker.ietf.org/doc/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href="https://datatracker.ietf.org/doc/html/rfc2119">https://datatracker.ietf.org/doc/html/rfc2119</a>
431+
<dd>S. Bradner. <a href="https://datatracker.ietf.org/doc/html/rfc2119"><cite>Key words for use in RFCs to Indicate Requirement Levels</cite></a>. March 1997. Best Current Practice. URL: <a href="https://datatracker.ietf.org/doc/html/rfc2119">https://datatracker.ietf.org/doc/html/rfc2119</a>
432432
</dl>

tests/biblio003.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -421,12 +421,12 @@ <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
421421
</nav>
422422
<main>
423423
<p><a data-link-type="biblio" href="#biblio-rfc2119">[RFC2119]</a></p>
424-
<p><a data-biblio-display="inline" data-link-type="biblio" href="https://datatracker.ietf.org/doc/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a></p>
424+
<p><a data-biblio-display="inline" data-link-type="biblio" href="https://datatracker.ietf.org/doc/html/rfc2119"><cite>Key words for use in RFCs to Indicate Requirement Levels</cite></a></p>
425425
<p><a data-biblio-display="index" data-link-type="biblio" href="#biblio-rfc2119">[RFC2119]</a></p>
426426
</main>
427427
<h2 class="no-num no-ref heading settled" id="references"><span class="content">References</span></h2>
428428
<h3 class="no-num no-ref heading settled" id="informative"><span class="content">Informative References</span></h3>
429429
<dl>
430430
<dt id="biblio-rfc2119">[RFC2119]
431-
<dd>S. Bradner. <a href="https://datatracker.ietf.org/doc/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href="https://datatracker.ietf.org/doc/html/rfc2119">https://datatracker.ietf.org/doc/html/rfc2119</a>
431+
<dd>S. Bradner. <a href="https://datatracker.ietf.org/doc/html/rfc2119"><cite>Key words for use in RFCs to Indicate Requirement Levels</cite></a>. March 1997. Best Current Practice. URL: <a href="https://datatracker.ietf.org/doc/html/rfc2119">https://datatracker.ietf.org/doc/html/rfc2119</a>
432432
</dl>

tests/biblio004.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -420,13 +420,13 @@ <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
420420
</ol>
421421
</nav>
422422
<main>
423-
<p><a data-link-type="biblio" href="https://datatracker.ietf.org/doc/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a></p>
424-
<p><a data-biblio-display="inline" data-link-type="biblio" href="https://datatracker.ietf.org/doc/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a></p>
423+
<p><a data-link-type="biblio" href="https://datatracker.ietf.org/doc/html/rfc2119"><cite>Key words for use in RFCs to Indicate Requirement Levels</cite></a></p>
424+
<p><a data-biblio-display="inline" data-link-type="biblio" href="https://datatracker.ietf.org/doc/html/rfc2119"><cite>Key words for use in RFCs to Indicate Requirement Levels</cite></a></p>
425425
<p><a data-biblio-display="index" data-link-type="biblio" href="#biblio-rfc2119">[RFC2119]</a></p>
426426
</main>
427427
<h2 class="no-num no-ref heading settled" id="references"><span class="content">References</span></h2>
428428
<h3 class="no-num no-ref heading settled" id="informative"><span class="content">Informative References</span></h3>
429429
<dl>
430430
<dt id="biblio-rfc2119">[RFC2119]
431-
<dd>S. Bradner. <a href="https://datatracker.ietf.org/doc/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href="https://datatracker.ietf.org/doc/html/rfc2119">https://datatracker.ietf.org/doc/html/rfc2119</a>
431+
<dd>S. Bradner. <a href="https://datatracker.ietf.org/doc/html/rfc2119"><cite>Key words for use in RFCs to Indicate Requirement Levels</cite></a>. March 1997. Best Current Practice. URL: <a href="https://datatracker.ietf.org/doc/html/rfc2119">https://datatracker.ietf.org/doc/html/rfc2119</a>
432432
</dl>

tests/biblio005.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -427,5 +427,5 @@ <h2 class="no-num no-ref heading settled" id="references"><span class="content">
427427
<h3 class="no-num no-ref heading settled" id="informative"><span class="content">Informative References</span></h3>
428428
<dl>
429429
<dt id="biblio-dom-level-2-style">[DOM-LEVEL-2-STYLE]
430-
<dd>Chris Wilson; Philippe Le Hégaret. <a href="https://www.w3.org/TR/DOM-Level-2-Style/">Document Object Model (DOM) Level 2 Style Specification</a>. 3 November 2020. REC. URL: <a href="https://www.w3.org/TR/DOM-Level-2-Style/">https://www.w3.org/TR/DOM-Level-2-Style/</a>
430+
<dd>Chris Wilson; Philippe Le Hégaret. <a href="https://www.w3.org/TR/DOM-Level-2-Style/"><cite>Document Object Model (DOM) Level 2 Style Specification</cite></a>. 3 November 2020. REC. URL: <a href="https://www.w3.org/TR/DOM-Level-2-Style/">https://www.w3.org/TR/DOM-Level-2-Style/</a>
431431
</dl>

tests/biblio006.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
420420
</ol>
421421
</nav>
422422
<main>
423-
<p><a data-biblio-display="inline" data-link-type="biblio" href="#biblio-jis4051">Formatting rules for Japanese documents (『日本語文書の組版方法』).</a></p>
423+
<p><a data-biblio-display="inline" data-link-type="biblio" href="#biblio-jis4051"><cite>Formatting rules for Japanese documents (『日本語文書の組版方法』).</cite></a></p>
424424
<p><a data-biblio-display="inline" data-link-type="biblio" href="https://datatracker.ietf.org/doc/html/rfc2119">custom text here should work</a></p>
425425
<p><a data-biblio-display="inline" data-link-type="biblio" href="#biblio-jis4051">not sure why inline is useful on a document without a URL, but hey, the syntax’s there, so it might as well work</a></p>
426426
</main>
@@ -430,5 +430,5 @@ <h3 class="no-num no-ref heading settled" id="informative"><span class="content"
430430
<dt id="biblio-jis4051">[JIS4051]
431431
<dd><cite>Formatting rules for Japanese documents (『日本語文書の組版方法』).</cite> Japanese Standards Association. 2004. JIS X 4051:2004. In Japanese
432432
<dt id="biblio-rfc2119">[RFC2119]
433-
<dd>S. Bradner. <a href="https://datatracker.ietf.org/doc/html/rfc2119">Key words for use in RFCs to Indicate Requirement Levels</a>. March 1997. Best Current Practice. URL: <a href="https://datatracker.ietf.org/doc/html/rfc2119">https://datatracker.ietf.org/doc/html/rfc2119</a>
433+
<dd>S. Bradner. <a href="https://datatracker.ietf.org/doc/html/rfc2119"><cite>Key words for use in RFCs to Indicate Requirement Levels</cite></a>. March 1997. Best Current Practice. URL: <a href="https://datatracker.ietf.org/doc/html/rfc2119">https://datatracker.ietf.org/doc/html/rfc2119</a>
434434
</dl>

tests/caniuse001.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
483483
<h2 class="no-num no-ref heading settled" id="index"><span class="content">Index</span></h2>
484484
<h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="content">Terms defined by this specification</span></h3>
485485
<ul class="index">
486-
<li><a href="#insertadjacentelement-where-element">insertAdjacentElement(where, element)</a><span>, in §Unnumbered section</span>
486+
<li><a href="#insertadjacentelement-where-element">insertAdjacentElement(where, element)</a><span>, in §Unnumbered section</span>
487487
</ul>
488488
<script>/* script-caniuse-panel */
489489

tests/css-production-range001.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ <h2 class="no-num no-ref heading settled" id="references"><span class="content">
512512
<h3 class="no-num no-ref heading settled" id="normative"><span class="content">Normative References</span></h3>
513513
<dl>
514514
<dt id="biblio-css-values-4">[CSS-VALUES-4]
515-
<dd>Tab Atkins Jr.; Elika Etemad. <a href="https://www.w3.org/TR/css-values-4/">CSS Values and Units Module Level 4</a>. 11 November 2020. WD. URL: <a href="https://www.w3.org/TR/css-values-4/">https://www.w3.org/TR/css-values-4/</a>
515+
<dd>Tab Atkins Jr.; Elika Etemad. <a href="https://www.w3.org/TR/css-values-4/"><cite>CSS Values and Units Module Level 4</cite></a>. 11 November 2020. WD. URL: <a href="https://www.w3.org/TR/css-values-4/">https://www.w3.org/TR/css-values-4/</a>
516516
</dl>
517517
<script>/* script-dfn-panel */
518518

tests/dict-type.html

+4-4
Original file line numberDiff line numberDiff line change
@@ -619,9 +619,9 @@ <h2 class="heading settled" data-level="1" id="test"><span class="secno">1. </sp
619619
<h2 class="no-num no-ref heading settled" id="index"><span class="content">Index</span><a class="self-link" href="#index"></a></h2>
620620
<h3 class="no-num no-ref heading settled" id="index-defined-here"><span class="content">Terms defined by this specification</span><a class="self-link" href="#index-defined-here"></a></h3>
621621
<ul class="index">
622-
<li><a href="#dom-dictwithdefaults-arraywithdefaultempty">arrayWithDefaultEmpty</a><span>, in §1</span>
623-
<li><a href="#dom-dictwithdefaults-dictwithdefaultempty">dictWithDefaultEmpty</a><span>, in §1</span>
624-
<li><a href="#dictdef-dictwithdefaults">DictWithDefaults</a><span>, in §1</span>
622+
<li><a href="#dom-dictwithdefaults-arraywithdefaultempty">arrayWithDefaultEmpty</a><span>, in §1</span>
623+
<li><a href="#dom-dictwithdefaults-dictwithdefaultempty">dictWithDefaultEmpty</a><span>, in §1</span>
624+
<li><a href="#dictdef-dictwithdefaults">DictWithDefaults</a><span>, in §1</span>
625625
</ul>
626626
<aside class="dfn-panel" data-for="term-for-idl-long">
627627
<a href="https://heycam.github.io/webidl/#idl-long">https://heycam.github.io/webidl/#idl-long</a><b>Referenced in:</b>
@@ -648,7 +648,7 @@ <h2 class="no-num no-ref heading settled" id="references"><span class="content">
648648
<h3 class="no-num no-ref heading settled" id="normative"><span class="content">Normative References</span><a class="self-link" href="#normative"></a></h3>
649649
<dl>
650650
<dt id="biblio-webidl">[WebIDL]
651-
<dd>Boris Zbarsky. <a href="https://heycam.github.io/webidl/">Web IDL</a>. 15 December 2016. ED. URL: <a href="https://heycam.github.io/webidl/">https://heycam.github.io/webidl/</a>
651+
<dd>Boris Zbarsky. <a href="https://heycam.github.io/webidl/"><cite>Web IDL</cite></a>. 15 December 2016. ED. URL: <a href="https://heycam.github.io/webidl/">https://heycam.github.io/webidl/</a>
652652
</dl>
653653
<h2 class="no-num no-ref heading settled" id="idl-index"><span class="content">IDL Index</span><a class="self-link" href="#idl-index"></a></h2>
654654
<pre class="idl highlight def"><c- b>dictionary</c-> <a href="#dictdef-dictwithdefaults"><code><c- g>DictWithDefaults</c-></code></a> {

0 commit comments

Comments
 (0)