GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — doc: prevent displaying empty version picker · sclarson/node@2b7b9f2

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • doc
    • api_assets
      • style.css
    • template.html
  • tools/doc
    • html.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/api_assets/style.css‎

Copy file name to clipboardExpand all lines: doc/api_assets/style.css
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,15 @@ em code {
9191

9292
#gtoc li {
9393
display: inline;
94+
border-right: 1px #000 solid;
95+
margin-right: 0.4em;
96+
padding-right: 0.4em;
97+
}
98+
99+
#gtoc li:last-child {
100+
border-right: none;
101+
margin-right: 0;
102+
padding-right: 0;
94103
}
95104

96105
li.version-picker {
@@ -118,6 +127,8 @@ ol.version-picker {
118127

119128
#gtoc ol.version-picker li {
120129
display: block;
130+
border-right: 0;
131+
margin-right: 0;
121132
}
122133

123134
ol.version-picker li a {
Collapse file

‎doc/template.html‎

Copy file name to clipboardExpand all lines: doc/template.html
+4-7Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,15 @@ <h1>Node.js __VERSION__ Documentation</h1>
2525
<div id="gtoc">
2626
<ul>
2727
<li>
28-
<a href="index.html" name="toc">Index</a> |
28+
<a href="index.html" name="toc">Index</a>
2929
</li>
3030
<li>
31-
<a href="all.html">View on single page</a> |
31+
<a href="all.html">View on single page</a>
3232
</li>
3333
<li>
34-
<a href="__FILENAME__.json">View as JSON</a> |
35-
</li>
36-
<li class="version-picker">
37-
<a href="#">View another version <span>&#x25bc;</span></a>
38-
__ALTDOCS__
34+
<a href="__FILENAME__.json">View as JSON</a>
3935
</li>
36+
__ALTDOCS__
4037
</ul>
4138
</div>
4239
<hr>
Collapse file

‎tools/doc/html.js‎

Copy file name to clipboardExpand all lines: tools/doc/html.js
+10-2Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,9 +232,17 @@ function altDocs(filename) {
232232
return html + '</a></li>';
233233
}
234234

235-
const lis = (vs) => vs.filter(lte).map(li).join('\n');
235+
const lis = versions.filter(lte).map(li).join('\n');
236236

237-
return `<ol class="version-picker">${lis(versions)}</ol>`;
237+
if (!lis.length)
238+
return '';
239+
240+
return `
241+
<li class="version-picker">
242+
<a href="#">View another version <span>&#x25bc;</span></a>
243+
<ol class="version-picker">${lis}</ol>
244+
</li>
245+
`;
238246
}
239247

240248
// handle general body-text replacements

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.