Skip to content

Commit

Permalink
doc: addressed misc review comments
Browse files Browse the repository at this point in the history
Fixes: #10726
  • Loading branch information
Chris Young committed Aug 26, 2017
1 parent cb4622f commit d01c036
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion doc/api/addons.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<!--introduced_in=v0.10.0-->

Node.js Addons are dynamically-linked shared objects, written in C or C++, that
Node.js Addons are dynamically-linked shared objects, written in C++, that
can be loaded into Node.js using the [`require()`][require] function, and used
just as if they were an ordinary Node.js module. They are used primarily to
provide an interface between JavaScript running in Node.js and C/C++ libraries.
Expand Down
2 changes: 1 addition & 1 deletion doc/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ <h1>Node.js __VERSION__ Documentation</h1>
<a href="__FILENAME__.json">View as JSON</a> |
</li>
<li class="version-picker">
<a href="#">View another version <span>&#x25bc</span></a>
<a href="#">View another version <span>&#x25bc;</span></a>
__ALTDOCS__
</li>
</ul>
Expand Down
11 changes: 6 additions & 5 deletions tools/doc/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const typeParser = require('./type-parser.js');
module.exports = toHTML;

const STABILITY_TEXT_REG_EXP = /(.*:)\s*(\d)([\s\S]*)/;
const DOC_CREATED_REG_EXP = /<!--introduced_in=v([0-9]+).([0-9]+).([0-9]+)-->/;
const DOC_CREATED_REG_EXP = /<!--introduced_in( )?=( )?v([0-9]+)\.([0-9]+)\.([0-9]+)-->/;

// customized heading without id attribute
const renderer = new marked.Renderer();
Expand Down Expand Up @@ -199,16 +199,17 @@ function altDocs(filename) {
let html = '';

if (!docCreated) {
console.error('Failed to add alternative version links');
console.error(`Failed to add alternative version links to ${filename}`);
return html;
}

function lte(v) {
if (docCreated[1] > v.num[0])
const ns = v.num.split('.');
if (docCreated[1] > +ns[0])
return false;
if (docCreated[1] < v.num[0])
if (docCreated[1] < +ns[0])
return true;
return docCreated[2] <= v.num.substr(2, 2);
return docCreated[2] <= +ns[1];
}

const versions = [
Expand Down

0 comments on commit d01c036

Please sign in to comment.