mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
jsdoc: Always use Link.filemap in order to rename _global_.html to global.html, and also the templatedocs links to that page.
This commit is contained in:
parent
75da343022
commit
127b572026
1 changed files with 18 additions and 18 deletions
|
@ -51,23 +51,24 @@ function publish(symbolSet) {
|
||||||
|
|
||||||
// create a filemap in which outfiles must be to be named uniquely, ignoring case
|
// 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
|
// Since we want lowercase links in templatedocs, we always use this
|
||||||
if (JSDOC.opt.u || templatedocs) {
|
var filemapCounts = {};
|
||||||
var filemapCounts = {};
|
Link.filemap = {};
|
||||||
Link.filemap = {};
|
for (var i = 0, l = classes.length; i < l; i++) {
|
||||||
for (var i = 0, l = classes.length; i < l; i++) {
|
var alias = classes[i].alias,
|
||||||
var alias = classes[i].alias,
|
lcAlias = alias.toLowerCase();
|
||||||
lcAlias = alias.toLowerCase();
|
|
||||||
|
if (!filemapCounts[lcAlias]) {
|
||||||
if (!filemapCounts[lcAlias]) {
|
filemapCounts[lcAlias] = 1;
|
||||||
filemapCounts[lcAlias] = 1;
|
} else {
|
||||||
} else {
|
filemapCounts[lcAlias]++;
|
||||||
filemapCounts[lcAlias]++;
|
|
||||||
}
|
|
||||||
// Use lowercase links for templatedocs
|
|
||||||
var linkAlias = templatedocs ? lcAlias : alias;
|
|
||||||
Link.filemap[alias] = filemapCounts[lcAlias] > 1
|
|
||||||
? linkAlias + '_' + filemapCounts[lcAlias] : linkAlias;
|
|
||||||
}
|
}
|
||||||
|
// 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
|
// create each of the class pages
|
||||||
|
@ -83,8 +84,7 @@ function publish(symbolSet) {
|
||||||
|
|
||||||
Link.currentSymbol= symbol;
|
Link.currentSymbol= symbol;
|
||||||
var html = Render._class(symbol);
|
var html = Render._class(symbol);
|
||||||
var name = ((JSDOC.opt.u)? Link.filemap[symbol.alias] : symbol.alias)
|
var name = Link.filemap[symbol.alias] + extension;
|
||||||
+ extension;
|
|
||||||
if (renderMode == 'docs') {
|
if (renderMode == 'docs') {
|
||||||
html = Render.html({
|
html = Render.html({
|
||||||
content: html,
|
content: html,
|
||||||
|
|
Loading…
Reference in a new issue