Skip to content

Commit

Permalink
docs: Clean up doc generation
Browse files Browse the repository at this point in the history
The "globals" section on the right hand side of the generated docs was
full of useless garbage.  Similarly, the main page of the docs had a
footer listing a few random files that use @fileoverview in them.
Both of these have been removed from the jsdoc template.

Change-Id: I6d549274cb82df997da8a2e5abfad5669146ad9f
  • Loading branch information
joeyparrish committed Nov 17, 2020
1 parent cb38573 commit 0b20cc7
Showing 1 changed file with 5 additions and 35 deletions.
40 changes: 5 additions & 35 deletions docs/jsdoc-template/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,6 @@ function linktoExternal(longName, name) {
* @param {object} members The members that will be used to create the sidebar.
* @param {array<object>} members.classes
* @param {array<object>} members.externals
* @param {array<object>} members.globals
* @param {array<object>} members.mixins
* @param {array<object>} members.modules
* @param {array<object>} members.namespaces
Expand All @@ -432,7 +431,6 @@ function linktoExternal(longName, name) {
* @return {string} The HTML for the navigation sidebar.
*/
function buildNav(members) {
let globalNav;
let nav = '<h2><a href="index.html">Home</a></h2>';
const seen = {};
const seenTutorials = {};
Expand Down Expand Up @@ -463,25 +461,6 @@ function buildNav(members) {
}
}

if (members.globals.length) {
globalNav = '';

members.globals.forEach(({kind, longname, name}) => {
if ( kind !== 'typedef' && !hasOwnProp.call(seen, longname) ) {
globalNav += `<li>${linkto(longname, name)}</li>`;
}
seen[longname] = true;
});

if (!globalNav) {
// turn the heading into a link so you can actually get to the global page
nav += `<h3>${linkto('global', 'Global')}</h3>`;
}
else {
nav += `<h3>Global</h3><ul>${globalNav}</ul>`;
}
}

return nav;
}

Expand All @@ -508,7 +487,6 @@ exports.publish = (taffyData, opts, tutorials) => {
let externals;
let files;
let fromDir;
let globalUrl;
let indexUrl;
let interfaces;
let members;
Expand Down Expand Up @@ -539,9 +517,6 @@ exports.publish = (taffyData, opts, tutorials) => {
indexUrl = helper.getUniqueFilename('index');
// don't call registerLink() on this one! 'index' is also a valid longname

globalUrl = helper.getUniqueFilename('global');
helper.registerLink('global', globalUrl);

// set up templating
view.layout = conf.default.layoutFile ?
path.getResourcePath(path.dirname(conf.default.layoutFile),
Expand Down Expand Up @@ -791,20 +766,15 @@ exports.publish = (taffyData, opts, tutorials) => {
generateSourceFiles(sourceFiles, opts.encoding);
}

if (members.globals.length) { generate('Global', [{kind: 'globalobj'}], globalUrl); }

// index page displays information from package.json and lists files
files = find({kind: 'file'});
packages = find({kind: 'package'});

generate('Home',
packages.concat(
[{
kind: 'mainpage',
readme: opts.readme,
longname: (opts.mainpagetitle) ? opts.mainpagetitle : 'Main Page'
}]
).concat(files), indexUrl);
generate('Home', [{
kind: 'mainpage',
readme: opts.readme,
longname: (opts.mainpagetitle) ? opts.mainpagetitle : 'Main Page'
}], indexUrl);

// set up the lists that we'll use to generate pages
classes = taffy(members.classes);
Expand Down

0 comments on commit 0b20cc7

Please sign in to comment.