@@ -99,20 +99,14 @@ function shortenPaths(files, commonPrefix) {
99
99
return files ;
100
100
}
101
101
102
- function resolveSourcePath ( filepath ) {
103
- return path . resolve ( process . cwd ( ) , filepath ) ;
104
- }
105
-
106
102
function getPathFromDoclet ( doclet ) {
107
103
if ( ! doclet . meta ) {
108
104
return ;
109
105
}
110
106
111
- var filepath = doclet . meta . path && doclet . meta . path !== 'null' ?
107
+ return doclet . meta . path && doclet . meta . path !== 'null' ?
112
108
doclet . meta . path + '/' + doclet . meta . filename :
113
109
doclet . meta . filename ;
114
-
115
- return filepath ;
116
110
}
117
111
118
112
function generate ( title , docs , filename , resolveLinks ) {
@@ -140,7 +134,7 @@ function generate(title, docs, filename, resolveLinks) {
140
134
function generateSourceFiles ( sourceFiles ) {
141
135
Object . keys ( sourceFiles ) . forEach ( function ( file ) {
142
136
var source ;
143
- // links are keyed to the shortened path in each doclet's `meta.filename ` property
137
+ // links are keyed to the shortened path in each doclet's `meta.shortpath. ` property
144
138
var sourceOutfile = helper . getUniqueFilename ( sourceFiles [ file ] . shortened ) ;
145
139
helper . registerLink ( sourceFiles [ file ] . shortened , sourceOutfile ) ;
146
140
@@ -318,15 +312,13 @@ exports.publish = function(taffyData, opts, tutorials) {
318
312
319
313
// build a list of source files
320
314
var sourcePath ;
321
- var resolvedSourcePath ;
322
315
if ( doclet . meta ) {
323
316
sourcePath = getPathFromDoclet ( doclet ) ;
324
- resolvedSourcePath = resolveSourcePath ( sourcePath ) ;
325
317
sourceFiles [ sourcePath ] = {
326
- resolved : resolvedSourcePath ,
318
+ resolved : sourcePath ,
327
319
shortened : null
328
320
} ;
329
- sourceFilePaths . push ( resolvedSourcePath ) ;
321
+ sourceFilePaths . push ( sourcePath ) ;
330
322
}
331
323
} ) ;
332
324
@@ -376,13 +368,13 @@ exports.publish = function(taffyData, opts, tutorials) {
376
368
var url = helper . createLink ( doclet ) ;
377
369
helper . registerLink ( doclet . longname , url ) ;
378
370
379
- // replace the filename with a shortened version of the full path
371
+ // add a shortened version of the full path
380
372
var docletPath ;
381
373
if ( doclet . meta ) {
382
374
docletPath = getPathFromDoclet ( doclet ) ;
383
375
docletPath = sourceFiles [ docletPath ] . shortened ;
384
376
if ( docletPath ) {
385
- doclet . meta . filename = docletPath ;
377
+ doclet . meta . shortpath = docletPath ;
386
378
}
387
379
}
388
380
} ) ;
0 commit comments