From 127b5720267fe8e73b4080d509817b120d4bd7c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Wed, 8 Jun 2011 17:34:50 +0100 Subject: [PATCH] jsdoc: Always use Link.filemap in order to rename _global_.html to global.html, and also the templatedocs links to that page. --- .../jsdoc-toolkit/templates/jsdoc/publish.js | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/build/jsdoc-toolkit/templates/jsdoc/publish.js b/build/jsdoc-toolkit/templates/jsdoc/publish.js index c0b5e6e9..2fa15d38 100644 --- a/build/jsdoc-toolkit/templates/jsdoc/publish.js +++ b/build/jsdoc-toolkit/templates/jsdoc/publish.js @@ -51,23 +51,24 @@ function publish(symbolSet) { // create a filemap in which outfiles must be to be named uniquely, ignoring case // Since we want lowercase links in templatedocs, we always use this - if (JSDOC.opt.u || templatedocs) { - var filemapCounts = {}; - Link.filemap = {}; - for (var i = 0, l = classes.length; i < l; i++) { - var alias = classes[i].alias, - lcAlias = alias.toLowerCase(); - - if (!filemapCounts[lcAlias]) { - filemapCounts[lcAlias] = 1; - } else { - filemapCounts[lcAlias]++; - } - // Use lowercase links for templatedocs - var linkAlias = templatedocs ? lcAlias : alias; - Link.filemap[alias] = filemapCounts[lcAlias] > 1 - ? linkAlias + '_' + filemapCounts[lcAlias] : linkAlias; + var filemapCounts = {}; + Link.filemap = {}; + for (var i = 0, l = classes.length; i < l; i++) { + var alias = classes[i].alias, + lcAlias = alias.toLowerCase(); + + if (!filemapCounts[lcAlias]) { + filemapCounts[lcAlias] = 1; + } else { + filemapCounts[lcAlias]++; } + // Use lowercase links for templatedocs + var linkAlias = templatedocs ? lcAlias : alias; + // Rename _global_.html to global.html + if (linkAlias == '_global_') + linkAlias = 'global'; + Link.filemap[alias] = filemapCounts[lcAlias] > 1 + ? linkAlias + '_' + filemapCounts[lcAlias] : linkAlias; } // create each of the class pages @@ -83,8 +84,7 @@ function publish(symbolSet) { Link.currentSymbol= symbol; var html = Render._class(symbol); - var name = ((JSDOC.opt.u)? Link.filemap[symbol.alias] : symbol.alias) - + extension; + var name = Link.filemap[symbol.alias] + extension; if (renderMode == 'docs') { html = Render.html({ content: html,