Skip to content

Commit 3953de4

Browse files
committed
Update pkgdown files
1 parent fd9a6dd commit 3953de4

File tree

31 files changed

+385
-21
lines changed

31 files changed

+385
-21
lines changed

docs/articles/v01-dataone-overview.html

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Hide empty <a> tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) -->
2+
// v0.0.1
3+
// Written by JooYoung Seo ([email protected]) and Atsushi Yasumoto on June 1st, 2020.
4+
5+
document.addEventListener('DOMContentLoaded', function() {
6+
const codeList = document.getElementsByClassName("sourceCode");
7+
for (var i = 0; i < codeList.length; i++) {
8+
var linkList = codeList[i].getElementsByTagName('a');
9+
for (var j = 0; j < linkList.length; j++) {
10+
if (linkList[j].innerHTML === "") {
11+
linkList[j].setAttribute('aria-hidden', 'true');
12+
}
13+
}
14+
}
15+
});
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/* Styles for section anchors */
2+
a.anchor-section {margin-left: 10px; visibility: hidden; color: inherit;}
3+
a.anchor-section::before {content: '#';}
4+
.hasAnchor:hover a.anchor-section {visibility: visible;}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Anchor sections v1.0 written by Atsushi Yasumoto on Oct 3rd, 2020.
2+
document.addEventListener('DOMContentLoaded', function() {
3+
// Do nothing if AnchorJS is used
4+
if (typeof window.anchors === 'object' && anchors.hasOwnProperty('hasAnchorJSLink')) {
5+
return;
6+
}
7+
8+
const h = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
9+
10+
// Do nothing if sections are already anchored
11+
if (Array.from(h).some(x => x.classList.contains('hasAnchor'))) {
12+
return null;
13+
}
14+
15+
// Use section id when pandoc runs with --section-divs
16+
const section_id = function(x) {
17+
return ((x.classList.contains('section') || (x.tagName === 'SECTION'))
18+
? x.id : '');
19+
};
20+
21+
// Add anchors
22+
h.forEach(function(x) {
23+
const id = x.id || section_id(x.parentElement);
24+
if (id === '') {
25+
return null;
26+
}
27+
let anchor = document.createElement('a');
28+
anchor.href = '#' + id;
29+
anchor.classList = ['anchor-section'];
30+
x.classList.add('hasAnchor');
31+
x.appendChild(anchor);
32+
});
33+
});

docs/articles/v02-dataone-federation.html

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Hide empty <a> tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) -->
2+
// v0.0.1
3+
// Written by JooYoung Seo ([email protected]) and Atsushi Yasumoto on June 1st, 2020.
4+
5+
document.addEventListener('DOMContentLoaded', function() {
6+
const codeList = document.getElementsByClassName("sourceCode");
7+
for (var i = 0; i < codeList.length; i++) {
8+
var linkList = codeList[i].getElementsByTagName('a');
9+
for (var j = 0; j < linkList.length; j++) {
10+
if (linkList[j].innerHTML === "") {
11+
linkList[j].setAttribute('aria-hidden', 'true');
12+
}
13+
}
14+
}
15+
});
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/* Styles for section anchors */
2+
a.anchor-section {margin-left: 10px; visibility: hidden; color: inherit;}
3+
a.anchor-section::before {content: '#';}
4+
.hasAnchor:hover a.anchor-section {visibility: visible;}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// Anchor sections v1.0 written by Atsushi Yasumoto on Oct 3rd, 2020.
2+
document.addEventListener('DOMContentLoaded', function() {
3+
// Do nothing if AnchorJS is used
4+
if (typeof window.anchors === 'object' && anchors.hasOwnProperty('hasAnchorJSLink')) {
5+
return;
6+
}
7+
8+
const h = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
9+
10+
// Do nothing if sections are already anchored
11+
if (Array.from(h).some(x => x.classList.contains('hasAnchor'))) {
12+
return null;
13+
}
14+
15+
// Use section id when pandoc runs with --section-divs
16+
const section_id = function(x) {
17+
return ((x.classList.contains('section') || (x.tagName === 'SECTION'))
18+
? x.id : '');
19+
};
20+
21+
// Add anchors
22+
h.forEach(function(x) {
23+
const id = x.id || section_id(x.parentElement);
24+
if (id === '') {
25+
return null;
26+
}
27+
let anchor = document.createElement('a');
28+
anchor.href = '#' + id;
29+
anchor.classList = ['anchor-section'];
30+
x.classList.add('hasAnchor');
31+
x.appendChild(anchor);
32+
});
33+
});

docs/articles/v03-searching-dataone.html

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Hide empty <a> tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) -->
2+
// v0.0.1
3+
// Written by JooYoung Seo ([email protected]) and Atsushi Yasumoto on June 1st, 2020.
4+
5+
document.addEventListener('DOMContentLoaded', function() {
6+
const codeList = document.getElementsByClassName("sourceCode");
7+
for (var i = 0; i < codeList.length; i++) {
8+
var linkList = codeList[i].getElementsByTagName('a');
9+
for (var j = 0; j < linkList.length; j++) {
10+
if (linkList[j].innerHTML === "") {
11+
linkList[j].setAttribute('aria-hidden', 'true');
12+
}
13+
}
14+
}
15+
});

0 commit comments

Comments
 (0)