function createTOC( contents, aliases, blacklist ) {
	var multiple;
	var descr;
	var links;
	var used;
	var pkgs;
	var arr;
	var fun;
	var pkg;
	var str;
	var toc;
	var val;
	var i;

	debug( 'Creating ToC...' );
	links = [];
	pkgs = [];
	used = [];
	toc = '<div class="namespace-toc">\n\n';
	for ( i = 0; i < contents.length; i++ ) {
		str = contents[ i ].data.toString();
		descr = RE_DESCR.exec( str )[ 1 ];
		descr = replace( descr, RE_LINKS, '$1' );
		descr = uncapitalizeDescription( descr );
		pkg = str.match( RE_PKG )[ 1 ];
		pkgs.push( pkg );
		debug( 'Processing package %s...', pkg );
		multiple = str.match( RE_FUN );
		if ( multiple && hasMultipleSignatures( multiple ) ) {
			fun = '()';
		} else {
			arr = RE_FUN_SIG.exec( str );
			if ( arr ) {
				fun = arr[ 1 ];
				fun = replace( fun, '\\[', '[' );
			} else {
				fun = '';
			}
		}
		if ( aliases[ pkg ] && isNotBlacklisted( pkg ) ) {
			used.push( pkg );
			toc += '-   <span class="signature">[`'+aliases[ pkg ]+fun+'`]['+pkg+']</span>';
			toc += '<span class="delimiter">: </span>';
			toc += '<span class="description">' + descr + '.</span>';
			toc += '\n';
			val = '['+pkg+']: https://github.com/stdlib-js/stdlib';
			if ( !contains( links, val ) ) {
				links.push( val );
			}
		}
	}
	toc += '\n';
	toc += '</div>';
	return {
		'toc': toc,
		'links': links,
		'packages': used
	};

	/**
	* Checks whether a package appears in the list of blacklisted package names.
	*
	* @private
	* @param {string} pkg - package name
	* @returns {boolean} boolean indicating whether a package is blacklisted
	*/
	function isNotBlacklisted( pkg ) {
		if ( !blacklist ) {
			return true;
		}
		if ( contains( blacklist, pkg ) ) {
			return false;
		}
		return true;
	}
}
Creates the table of contents and associated link section for insertion into the README.md document.

@private
@param {Array} contents - array of file contents
@param {Object} aliases - table mapping package names to aliases
@param {StringArray} [blacklist] - array of blacklisted packages
@returns {Object} object with `toc` and `links`