Skip to content

Commit

Permalink
Make auto-links to GH issues less obnoxious (#2143)
Browse files Browse the repository at this point in the history
  • Loading branch information
fantasai authored Sep 30, 2021
1 parent 2fe4eaf commit 8bb5020
Show file tree
Hide file tree
Showing 478 changed files with 5,977 additions and 1,214 deletions.
11 changes: 11 additions & 0 deletions bikeshed/Spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ def initializeState(self):
self.extraStyles["style-autolinks"] = styleAutolinks
self.extraStyles["style-selflinks"] = styleSelflinks
self.extraStyles["style-counters"] = styleCounters
self.extraStyles["style-issues"] = styleIssues
self.extraScripts = defaultdict(str)

try:
Expand Down Expand Up @@ -867,3 +868,13 @@ def findImplicitInputFile():
figcaption:not(.no-marker)::before {
content: "Figure " counter(figure) " ";
}"""

styleIssues = """
a[href].issue-return {
float: right;
float: inline-end;
color: var(--issueheading-text);
font-weight: bold;
text-decoration: none;
}
"""
4 changes: 3 additions & 1 deletion bikeshed/boilerplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,9 @@ def addIssuesSection(doc):
if el.tag not in ("pre", "xmp"):
el.tag = "div"
appendChild(container, el)
appendChild(el, E.a({"href": "#" + issue.get("id")}, " ↵ "))
appendChild(
el, " ", E.a({"href": "#" + issue.get("id"), "class": "issue-return", "title": "Jump to section"}, "↵")
)
for idel in findAll("[id]", container):
del idel.attrib["id"]
for dfnel in findAll(config.dfnElementsSelector, container):
Expand Down
2 changes: 1 addition & 1 deletion bikeshed/unsortedJunk.py
Original file line number Diff line number Diff line change
Expand Up @@ -1102,7 +1102,7 @@ def processIssuesAndExamples(doc):
elif doc.md.issueTrackerTemplate:
remoteIssueURL = doc.md.issueTrackerTemplate.format(remoteIssueID)
if remoteIssueURL:
appendChild(el, " ", E.a({"href": remoteIssueURL}, "<" + remoteIssueURL + ">"))
appendChild(el, " ", E.a({"href": remoteIssueURL}, "[Issue #" + remoteIssueID + "]"))
for el in findAll(".example:not([id])", doc):
el.set("id", safeID(doc, "example-" + hashContents(el)))
fixupIDs(doc, findAll(".issue, .example", doc))
Expand Down
10 changes: 10 additions & 0 deletions tests/abstract001.html
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,16 @@
figcaption:not(.no-marker)::before {
content: "Figure " counter(figure) " ";
}</style>
<style>/* style-issues */

a[href].issue-return {
float: right;
float: inline-end;
color: var(--issueheading-text);
font-weight: bold;
text-decoration: none;
}
</style>
<style>/* style-md-lists */

/* This is a weird hack for me not yet following the commonmark spec
Expand Down
10 changes: 10 additions & 0 deletions tests/adjacent-boilerplate/adjacent-boilerplate.html
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,16 @@

.dfn-paneled { cursor: pointer; }
</style>
<style>/* style-issues */

a.issue-return {
float: right;
float: end;
color: var(--issueheading-text);
font-weight: bold;
text-decoration: none;
}
</style>
<style>/* style-md-lists */

/* This is a weird hack for me not yet following the commonmark spec
Expand Down
12 changes: 11 additions & 1 deletion tests/advisement001.html
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,16 @@
figcaption:not(.no-marker)::before {
content: "Figure " counter(figure) " ";
}</style>
<style>/* style-issues */

a[href].issue-return {
float: right;
float: inline-end;
color: var(--issueheading-text);
font-weight: bold;
text-decoration: none;
}
</style>
<style>/* style-md-lists */

/* This is a weird hack for me not yet following the commonmark spec
Expand Down Expand Up @@ -428,5 +438,5 @@ <h2 class="no-num no-toc no-ref" id="contents">Table of Contents</h2>
</main>
<h2 class="no-num no-ref heading settled" id="issues-index"><span class="content">Issues Index</span></h2>
<div style="counter-reset:issue">
<div class="issue"> This is an issue.<a href="#issue-05237a4c"></a></div>
<div class="issue"> This is an issue. <a class="issue-return" href="#issue-05237a4c" title="Jump to section"></a></div>
</div>
10 changes: 10 additions & 0 deletions tests/algorithm001.html
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,16 @@
figcaption:not(.no-marker)::before {
content: "Figure " counter(figure) " ";
}</style>
<style>/* style-issues */

a[href].issue-return {
float: right;
float: inline-end;
color: var(--issueheading-text);
font-weight: bold;
text-decoration: none;
}
</style>
<style>/* style-md-lists */

/* This is a weird hack for me not yet following the commonmark spec
Expand Down
10 changes: 10 additions & 0 deletions tests/basic001.html
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,16 @@
figcaption:not(.no-marker)::before {
content: "Figure " counter(figure) " ";
}</style>
<style>/* style-issues */

a[href].issue-return {
float: right;
float: inline-end;
color: var(--issueheading-text);
font-weight: bold;
text-decoration: none;
}
</style>
<style>/* style-md-lists */

/* This is a weird hack for me not yet following the commonmark spec
Expand Down
10 changes: 10 additions & 0 deletions tests/biblio001.html
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,16 @@
figcaption:not(.no-marker)::before {
content: "Figure " counter(figure) " ";
}</style>
<style>/* style-issues */

a[href].issue-return {
float: right;
float: inline-end;
color: var(--issueheading-text);
font-weight: bold;
text-decoration: none;
}
</style>
<style>/* style-md-lists */

/* This is a weird hack for me not yet following the commonmark spec
Expand Down
10 changes: 10 additions & 0 deletions tests/biblio002.html
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,16 @@
figcaption:not(.no-marker)::before {
content: "Figure " counter(figure) " ";
}</style>
<style>/* style-issues */

a[href].issue-return {
float: right;
float: inline-end;
color: var(--issueheading-text);
font-weight: bold;
text-decoration: none;
}
</style>
<style>/* style-md-lists */

/* This is a weird hack for me not yet following the commonmark spec
Expand Down
10 changes: 10 additions & 0 deletions tests/biblio003.html
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,16 @@
figcaption:not(.no-marker)::before {
content: "Figure " counter(figure) " ";
}</style>
<style>/* style-issues */

a[href].issue-return {
float: right;
float: inline-end;
color: var(--issueheading-text);
font-weight: bold;
text-decoration: none;
}
</style>
<style>/* style-md-lists */

/* This is a weird hack for me not yet following the commonmark spec
Expand Down
10 changes: 10 additions & 0 deletions tests/biblio004.html
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,16 @@
figcaption:not(.no-marker)::before {
content: "Figure " counter(figure) " ";
}</style>
<style>/* style-issues */

a[href].issue-return {
float: right;
float: inline-end;
color: var(--issueheading-text);
font-weight: bold;
text-decoration: none;
}
</style>
<style>/* style-md-lists */

/* This is a weird hack for me not yet following the commonmark spec
Expand Down
10 changes: 10 additions & 0 deletions tests/biblio005.html
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,16 @@
figcaption:not(.no-marker)::before {
content: "Figure " counter(figure) " ";
}</style>
<style>/* style-issues */

a[href].issue-return {
float: right;
float: inline-end;
color: var(--issueheading-text);
font-weight: bold;
text-decoration: none;
}
</style>
<style>/* style-md-lists */

/* This is a weird hack for me not yet following the commonmark spec
Expand Down
10 changes: 10 additions & 0 deletions tests/biblio006.html
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,16 @@
figcaption:not(.no-marker)::before {
content: "Figure " counter(figure) " ";
}</style>
<style>/* style-issues */

a[href].issue-return {
float: right;
float: inline-end;
color: var(--issueheading-text);
font-weight: bold;
text-decoration: none;
}
</style>
<style>/* style-md-lists */

/* This is a weird hack for me not yet following the commonmark spec
Expand Down
10 changes: 10 additions & 0 deletions tests/boilerplate-substitution001.html
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,16 @@
figcaption:not(.no-marker)::before {
content: "Figure " counter(figure) " ";
}</style>
<style>/* style-issues */

a[href].issue-return {
float: right;
float: inline-end;
color: var(--issueheading-text);
font-weight: bold;
text-decoration: none;
}
</style>
<style>/* style-md-lists */

/* This is a weird hack for me not yet following the commonmark spec
Expand Down
10 changes: 10 additions & 0 deletions tests/caniuse001.html
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,16 @@
figcaption:not(.no-marker)::before {
content: "Figure " counter(figure) " ";
}</style>
<style>/* style-issues */

a[href].issue-return {
float: right;
float: inline-end;
color: var(--issueheading-text);
font-weight: bold;
text-decoration: none;
}
</style>
<style>/* style-md-lists */

/* This is a weird hack for me not yet following the commonmark spec
Expand Down
10 changes: 10 additions & 0 deletions tests/comments001.html
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,16 @@
figcaption:not(.no-marker)::before {
content: "Figure " counter(figure) " ";
}</style>
<style>/* style-issues */

a[href].issue-return {
float: right;
float: inline-end;
color: var(--issueheading-text);
font-weight: bold;
text-decoration: none;
}
</style>
<style>/* style-md-lists */

/* This is a weird hack for me not yet following the commonmark spec
Expand Down
10 changes: 10 additions & 0 deletions tests/conditional001.html
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,16 @@
figcaption:not(.no-marker)::before {
content: "Figure " counter(figure) " ";
}</style>
<style>/* style-issues */

a[href].issue-return {
float: right;
float: inline-end;
color: var(--issueheading-text);
font-weight: bold;
text-decoration: none;
}
</style>
<style>/* style-md-lists */

/* This is a weird hack for me not yet following the commonmark spec
Expand Down
10 changes: 10 additions & 0 deletions tests/conditional002.html
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,16 @@
figcaption:not(.no-marker)::before {
content: "Figure " counter(figure) " ";
}</style>
<style>/* style-issues */

a[href].issue-return {
float: right;
float: inline-end;
color: var(--issueheading-text);
font-weight: bold;
text-decoration: none;
}
</style>
<style>/* style-md-lists */

/* This is a weird hack for me not yet following the commonmark spec
Expand Down
10 changes: 10 additions & 0 deletions tests/conditional003.html
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,16 @@
figcaption:not(.no-marker)::before {
content: "Figure " counter(figure) " ";
}</style>
<style>/* style-issues */

a[href].issue-return {
float: right;
float: inline-end;
color: var(--issueheading-text);
font-weight: bold;
text-decoration: none;
}
</style>
<style>/* style-md-lists */

/* This is a weird hack for me not yet following the commonmark spec
Expand Down
10 changes: 10 additions & 0 deletions tests/css-production-range001.html
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,16 @@

.dfn-paneled { cursor: pointer; }
</style>
<style>/* style-issues */

a[href].issue-return {
float: right;
float: inline-end;
color: var(--issueheading-text);
font-weight: bold;
text-decoration: none;
}
</style>
<style>/* style-md-lists */

/* This is a weird hack for me not yet following the commonmark spec
Expand Down
10 changes: 10 additions & 0 deletions tests/dict-type.html
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,16 @@

.dfn-paneled { cursor: pointer; }
</style>
<style>/* style-issues */

a[href].issue-return {
float: right;
float: inline-end;
color: var(--issueheading-text);
font-weight: bold;
text-decoration: none;
}
</style>
<style>/* style-md-lists */

/* This is a weird hack for me not yet following the commonmark spec
Expand Down
10 changes: 10 additions & 0 deletions tests/elementdef001.html
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,16 @@

.dfn-paneled { cursor: pointer; }
</style>
<style>/* style-issues */

a[href].issue-return {
float: right;
float: inline-end;
color: var(--issueheading-text);
font-weight: bold;
text-decoration: none;
}
</style>
<style>/* style-md-lists */

/* This is a weird hack for me not yet following the commonmark spec
Expand Down
Loading

0 comments on commit 8bb5020

Please sign in to comment.