| author | hamidouk |
| Fri, 23 Dec 2011 11:38:47 +0100 | |
| branch | jsdoc |
| changeset 520 | fe008e95a716 |
| permissions | -rw-r--r-- |
|
520
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
1 |
/** Handle the creation of HTML links to documented symbols. |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
2 |
@constructor |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
3 |
*/ |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
4 |
function Link() { |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
5 |
this.alias = ""; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
6 |
this.src = ""; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
7 |
this.file = ""; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
8 |
this.text = ""; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
9 |
this.innerName = ""; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
10 |
this.classLink = false; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
11 |
this.targetName = ""; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
12 |
|
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
13 |
this.target = function(targetName) { |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
14 |
if (defined(targetName)) this.targetName = targetName; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
15 |
return this; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
16 |
} |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
17 |
this.inner = function(inner) { |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
18 |
if (defined(inner)) this.innerName = inner; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
19 |
return this; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
20 |
} |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
21 |
this.withText = function(text) { |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
22 |
if (defined(text)) this.text = text; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
23 |
return this; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
24 |
} |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
25 |
this.toSrc = function(filename) { |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
26 |
if (defined(filename)) this.src = filename; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
27 |
return this; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
28 |
} |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
29 |
this.toSymbol = function(alias) { |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
30 |
if (defined(alias)) this.alias = new String(alias); |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
31 |
return this; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
32 |
} |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
33 |
this.toClass = function(alias) { |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
34 |
this.classLink = true; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
35 |
return this.toSymbol(alias); |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
36 |
} |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
37 |
this.toFile = function(file) { |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
38 |
if (defined(file)) this.file = file; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
39 |
return this; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
40 |
} |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
41 |
|
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
42 |
this.toString = function() { |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
43 |
var linkString; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
44 |
var thisLink = this; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
45 |
|
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
46 |
if (this.alias) { |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
47 |
linkString = this.alias.replace(/(^|[^a-z$0-9_#.:^-])([|a-z$0-9_#.:^-]+)($|[^a-z$0-9_#.:^-])/i, |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
48 |
function(match, prematch, symbolName, postmatch) { |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
49 |
var symbolNames = symbolName.split("|"); |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
50 |
var links = []; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
51 |
for (var i = 0, l = symbolNames.length; i < l; i++) { |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
52 |
thisLink.alias = symbolNames[i]; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
53 |
links.push(thisLink._makeSymbolLink(symbolNames[i])); |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
54 |
} |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
55 |
return prematch+links.join("|")+postmatch; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
56 |
} |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
57 |
); |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
58 |
} |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
59 |
else if (this.src) { |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
60 |
linkString = thisLink._makeSrcLink(this.src); |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
61 |
} |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
62 |
else if (this.file) { |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
63 |
linkString = thisLink._makeFileLink(this.file); |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
64 |
} |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
65 |
|
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
66 |
return linkString; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
67 |
} |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
68 |
} |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
69 |
|
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
70 |
/** prefixed for hashes */ |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
71 |
Link.hashPrefix = ""; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
72 |
|
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
73 |
/** Appended to the front of relative link paths. */ |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
74 |
Link.base = ""; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
75 |
|
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
76 |
Link.symbolNameToLinkName = function(symbol) { |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
77 |
var linker = "", |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
78 |
ns = ""; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
79 |
|
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
80 |
if (symbol.isStatic) linker = "."; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
81 |
else if (symbol.isInner) linker = "-"; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
82 |
|
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
83 |
if (symbol.isEvent && !/^event:/.test(symbol.name)) { |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
84 |
ns = "event:"; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
85 |
} |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
86 |
return Link.hashPrefix+linker+ns+symbol.name; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
87 |
} |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
88 |
|
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
89 |
Link.getSymbol= function(alias) { |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
90 |
var symbol= Link.symbolSet.getSymbol(alias); |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
91 |
|
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
92 |
if (symbol) |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
93 |
return symbol; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
94 |
|
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
95 |
if ('#'!==alias.charAt(0) || !Link.currentSymbol) |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
96 |
return null; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
97 |
|
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
98 |
// resolve relative name |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
99 |
var container= Link.currentSymbol; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
100 |
|
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
101 |
while (container) |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
102 |
{ |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
103 |
symbol= Link.symbolSet.getSymbol(container.alias + alias); |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
104 |
if (symbol) |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
105 |
return symbol; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
106 |
|
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
107 |
// No superclass |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
108 |
if (!container.augments.length) |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
109 |
return null; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
110 |
|
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
111 |
container= Link.symbolSet.getSymbol(container.augments[0].desc); |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
112 |
} |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
113 |
|
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
114 |
return null; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
115 |
} |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
116 |
|
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
117 |
/** Create a link to another symbol. */ |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
118 |
Link.prototype._makeSymbolLink = function(alias) { |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
119 |
var linkBase = Link.base+publish.conf.symbolsDir; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
120 |
var linkTo = Link.getSymbol(alias); |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
121 |
var linkPath; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
122 |
var target = (this.targetName)? " target=\""+this.targetName+"\"" : ""; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
123 |
|
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
124 |
// if there is no symbol by that name just return the name unaltered |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
125 |
if (!linkTo) |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
126 |
return this.text || alias; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
127 |
|
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
128 |
// it's a symbol in another file |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
129 |
else { |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
130 |
if (!linkTo.is("CONSTRUCTOR") && !linkTo.isNamespace) { // it's a method or property |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
131 |
linkPath= (Link.filemap) ? Link.filemap[linkTo.memberOf] : |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
132 |
escape(linkTo.memberOf) || "_global_"; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
133 |
linkPath += publish.conf.ext + "#" + Link.symbolNameToLinkName(linkTo); |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
134 |
} |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
135 |
else { |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
136 |
linkPath = (Link.filemap)? Link.filemap[linkTo.alias] : escape(linkTo.alias); |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
137 |
linkPath += publish.conf.ext;// + (this.classLink? "":"#" + Link.hashPrefix + "constructor"); |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
138 |
} |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
139 |
linkPath = linkBase + linkPath |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
140 |
} |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
141 |
|
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
142 |
var linkText= this.text || alias; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
143 |
|
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
144 |
var link = {linkPath: linkPath, linkText: linkText, linkInner: (this.innerName? "#"+this.innerName : "")}; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
145 |
|
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
146 |
if (typeof JSDOC.PluginManager != "undefined") { |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
147 |
JSDOC.PluginManager.run("onSymbolLink", link); |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
148 |
} |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
149 |
|
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
150 |
return "<a href=\""+link.linkPath+link.linkInner+"\""+target+">"+link.linkText+"</a>"; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
151 |
} |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
152 |
|
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
153 |
/** Create a link to a source file. */ |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
154 |
Link.prototype._makeSrcLink = function(srcFilePath) { |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
155 |
var target = (this.targetName)? " target=\""+this.targetName+"\"" : ""; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
156 |
|
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
157 |
// transform filepath into a filename |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
158 |
var srcFile = srcFilePath.replace(/\.\.?[\\\/]/g, "").replace(/[:\\\/]/g, "_"); |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
159 |
var outFilePath = Link.base + publish.conf.srcDir + srcFile + publish.conf.ext; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
160 |
|
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
161 |
if (!this.text) this.text = FilePath.fileName(srcFilePath); |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
162 |
return "<a href=\""+outFilePath+"\""+target+">"+this.text+"</a>"; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
163 |
} |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
164 |
|
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
165 |
/** Create a link to a source file. */ |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
166 |
Link.prototype._makeFileLink = function(filePath) { |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
167 |
var target = (this.targetName)? " target=\""+this.targetName+"\"" : ""; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
168 |
|
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
169 |
var outFilePath = Link.base + filePath; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
170 |
|
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
171 |
if (!this.text) this.text = filePath; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
172 |
return "<a href=\""+outFilePath+"\""+target+">"+this.text+"</a>"; |
|
fe008e95a716
added jsdoc support, and a script to generate the docs.
hamidouk
parents:
diff
changeset
|
173 |
} |