Skip to content

Commit 9f4d3b1

Browse files
committed
removing unused files and moving publisher helpers to the templates
1 parent b3590ae commit 9f4d3b1

File tree

6 files changed

+176
-165
lines changed

6 files changed

+176
-165
lines changed

lib/jsdocs/frame/Opt.js

Lines changed: 0 additions & 134 deletions
This file was deleted.

lib/jsdocs/js-plate.js renamed to templates/default/js-plate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
@constructor
33
*/
4-
var Link = require("jsdocs/frame/link").Link;
4+
var Link = require("./link").Link;
55

66
// TODO: fix this global dependencies
77
var encoding, VERSION, copyright;

lib/jsdocs/frame/Link.js renamed to templates/default/link.js

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,34 +15,34 @@ var Link = exports.Link = function () {
1515
this.targetName = "";
1616

1717
this.target = function(targetName) {
18-
if (defined(targetName)) this.targetName = targetName;
18+
if (targetName !== undefined) this.targetName = targetName;
1919
return this;
2020
}
2121
this.inner = function(inner) {
22-
if (defined(inner)) this.innerName = inner;
22+
if (inner !== undefined) this.innerName = inner;
2323
return this;
2424
}
2525
this.withText = function(text) {
26-
if (defined(text)) this.text = text;
26+
if (text !== undefined) this.text = text;
2727
return this;
2828
}
2929
this.toSrc = function(filename) {
30-
if (defined(filename)) {
30+
if (filename !== undefined) {
3131
this.src = filename;
3232
this.text = filename;
3333
}
3434
return this;
3535
}
3636
this.toSymbol = function(alias) {
37-
if (defined(alias)) this.alias = new String(alias);
37+
if (alias !== undefined) this.alias = alias.toString();
3838
return this;
3939
}
4040
this.toClass = function(alias) {
4141
this.classLink = true;
4242
return this.toSymbol(alias);
4343
}
4444
this.toFile = function(file) {
45-
if (defined(file)) this.file = file;
45+
if (file !== undefined) this.file = file;
4646
return this;
4747
}
4848

@@ -59,7 +59,7 @@ var Link = exports.Link = function () {
5959
thisLink.alias = symbolNames[i];
6060
links.push(thisLink._makeSymbolLink(symbolNames[i]));
6161
}
62-
return prematch+links.join("|")+postmatch;
62+
return prematch + links.join("|") + postmatch;
6363
}
6464
);
6565
}
@@ -128,15 +128,12 @@ Link.prototype._makeSymbolLink = function(alias) {
128128

129129
/** Create a link to a source file. */
130130
Link.prototype._makeSrcLink = function(srcFilePath) {
131-
var target = (this.targetName)? " target=\""+this.targetName+"\"" : "";
132-
131+
var target = (this.targetName) ? ' target="' + this.targetName + '"' : '';
133132
// transform filepath into a filename
134133
var srcFile = srcFilePath.replace(/\.\.?[\\\/]/g, "").replace(/[:\\\/]/g, "_");
135-
var outFilePath = Link.base + Link.srcDir + srcFile + Link.ext;
136-
137-
134+
var outFilePath = Link.srcDir.join(srcFile + Link.ext);
138135
//if (!this.text) this.text = FilePath.fileName(srcFilePath);
139-
return "<a href=\""+outFilePath+"\""+target+">"+this.text+"</a>";
136+
return '<a href="--' + outFilePath + '"' + target + '>' + this.text + '</a>';
140137
}
141138

142139
/** Create a link to a source file. */
@@ -147,4 +144,8 @@ Link.prototype._makeFileLink = function(filePath) {
147144

148145
if (!this.text) this.text = filePath;
149146
return "<a href=\""+outFilePath+"\""+target+">"+this.text+"</a>";
147+
}
148+
149+
exports.link = function link() {
150+
150151
}

templates/default/publish.js

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** Called automatically by JsDoc Toolkit. */
2-
var Link = require("jsdocs/frame/link").Link;
3-
var JsPlate = require("jsdocs/js-plate").JsPlate;
2+
var Link = require("./link").Link;
3+
var JsPlate = require("./js-plate").JsPlate;
44
var console = require("system").log;
55
var OS = require("os");
66
var plugins = require("jsdocs/plugin-manager");
@@ -193,10 +193,6 @@ function makeSignature(params) {
193193
}
194194

195195

196-
/**
197-
@constructor
198-
*/
199-
var Link = require("jsdocs/frame/link").Link;
200196

201197
// TODO: fix this global dependencies
202198
var encoding, VERSION, copyright;
@@ -322,6 +318,6 @@ function resolveLinks(str, from) {
322318
}
323319

324320
function defined(o) {
325-
return (o !== undefined);
321+
return (o !== undefined);
326322
}
327323

0 commit comments

Comments
 (0)