function buildNav(readmeNav, members) {
    var nav = '<h2><a href="index.html">Index</a></h2>' + readmeNav,
        seen = {},
        hasClassList = false,
        classNav = '',
        globalNav = '';



    if (members.modules.length) {
        nav += '<h3>Modules</h3><ul>';
        members.modules.forEach(function(m) {
            if ( !hasOwnProp.call(seen, m.longname) ) {
                nav += '<li>'+linkto(m.longname, m.name)+'</li>';
            }
            seen[m.longname] = true;
        });

        nav += '</ul>';
    }

    if (members.externals.length) {
        nav += '<h3>Externals</h3><ul>';
        members.externals.forEach(function(e) {
            if ( !hasOwnProp.call(seen, e.longname) ) {
                nav += '<li>'+linkto( e.longname, e.name.replace(/(^"|"$)/g, '') )+'</li>';
            }
            seen[e.longname] = true;
        });

        nav += '</ul>';
    }

    if (members.classes.length) {
        members.classes.forEach(function(c) {
            if ( !hasOwnProp.call(seen, c.longname) ) {
                classNav += '<li>'+linkto(c.longname, c.name)+'</li>';
                if (c.longname in members.categories) {
                    classNav += '<ul>' + members.categories[c.longname].reduce(function(nav, cat) {
                        return nav + '<li> ' + getCategoryLink(c.longname, cat) + '</li>';
                    }, '') + '</ul>';
                }
            }
            seen[c.longname] = true;
        });

        if (classNav !== '') {
            nav += '<h3>Classes</h3><ul>';
            nav += classNav;
            nav += '</ul>';
        }
    }

    /*if (members.events.length) {
        nav += '<h3>Events</h3><ul>';
        members.events.forEach(function(e) {
            if ( !hasOwnProp.call(seen, e.longname) ) {
                nav += '<li>'+linkto(e.longname, e.name)+'</li>';
            }
            seen[e.longname] = true;
        });

        nav += '</ul>';
    }*/

    if (members.namespaces.length) {
        nav += '<h3>Namespaces</h3><ul>';
        members.namespaces.forEach(function(n) {
            if ( !hasOwnProp.call(seen, n.longname) ) {
                nav += '<li>'+linkto(n.longname, n.name)+'</li>';
            }
            seen[n.longname] = true;
        });

        nav += '</ul>';
    }

    if (members.mixins.length) {
        nav += '<h3>Mixins</h3><ul>';
        members.mixins.forEach(function(m) {
            if ( !hasOwnProp.call(seen, m.longname) ) {
                nav += '<li>'+linkto(m.longname, m.name)+'</li>';
            }
            seen[m.longname] = true;
        });

        nav += '</ul>';
    }

    if (members.tutorials.length) {
        nav += '<h3>Tutorials</h3><ul>';
        members.tutorials.forEach(function(t) {
            nav += '<li>'+tutoriallink(t.name)+'</li>';
        });

        nav += '</ul>';
    }

    if (members.globals.length) {
        members.globals.forEach(function(g) {
            if ( g.kind !== 'typedef' && !hasOwnProp.call(seen, g.longname) ) {
                globalNav += '<li>' + linkto(g.longname, g.name) + '</li>';
            }
            seen[g.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;
}
Create the navigation sidebar.
@param {String} readmeNav The readme TOC
@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
@param {array<object>} members.tutorials
@param {array<object>} members.events
@return {string} The HTML for the navigation sidebar.