diff --git a/config/jsdoc/api/template/publish.js b/config/jsdoc/api/template/publish.js index e5bbfe66ff..e9a479d893 100644 --- a/config/jsdoc/api/template/publish.js +++ b/config/jsdoc/api/template/publish.js @@ -110,12 +110,10 @@ function addSignatureTypes(f) { function shortenPaths(files, commonPrefix) { // always use forward slashes - const regexp = new RegExp('\\\\', 'g'); - Object.keys(files).forEach(function (file) { files[file].shortened = files[file].resolved .replace(commonPrefix, '') - .replace(regexp, '/'); + .replaceAll('\\', '/'); }); return files; diff --git a/config/jsdoc/api/template/static/scripts/linenumber.js b/config/jsdoc/api/template/static/scripts/linenumber.js index a0c570d5dd..6e7c81ce30 100644 --- a/config/jsdoc/api/template/static/scripts/linenumber.js +++ b/config/jsdoc/api/template/static/scripts/linenumber.js @@ -1,17 +1,11 @@ (function() { - var counter = 0; - var numbered; - var source = document.getElementsByClassName('prettyprint source'); - - if (source && source[0]) { - source = source[0].getElementsByTagName('code')[0]; - - numbered = source.innerHTML.split('\n'); - numbered = numbered.map(function(item) { - counter++; - return '' + item; - }); - - source.innerHTML = numbered.join('\n'); + const source = document.querySelector('.prettyprint.source > code'); + if (source) { + source.innerHTML = source.innerHTML + .split('\n') + .map(function (item, i) { + return '' + item; + }) + .join('\n'); } })(); diff --git a/config/jsdoc/info/publish.js b/config/jsdoc/info/publish.js index 5d1c015f1b..9597d4e217 100644 --- a/config/jsdoc/info/publish.js +++ b/config/jsdoc/info/publish.js @@ -14,11 +14,7 @@ const path = require('path'); */ exports.publish = function (data, opts) { function getTypes(data) { - const types = []; - data.forEach(function (name) { - types.push(name.replace(/^function$/, 'Function')); - }); - return types; + return data.map((name) => name.replace(/^function$/, 'Function')); } // get all doclets that have exports diff --git a/doc/quickstart.hbs b/doc/quickstart.hbs index f400873a26..22d4ab1cef 100644 --- a/doc/quickstart.hbs +++ b/doc/quickstart.hbs @@ -33,17 +33,17 @@ Below you'll find a complete working example. Create a new file, copy in the co