OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * To generate docs for a library, run this script with the path to an | 6 * To generate docs for a library, run this script with the path to an |
7 * entrypoint .dart file, like: | 7 * entrypoint .dart file, like: |
8 * | 8 * |
9 * $ dart dartdoc.dart foo.dart | 9 * $ dart dartdoc.dart foo.dart |
10 * | 10 * |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 } | 419 } |
420 content += '<div>${footerItems[i]}</div>'; | 420 content += '<div>${footerItems[i]}</div>'; |
421 } | 421 } |
422 return content; | 422 return content; |
423 } | 423 } |
424 | 424 |
425 Future documentLibraries(List<Uri> libraryList, String libPath, | 425 Future documentLibraries(List<Uri> libraryList, String libPath, |
426 String packageRoot) { | 426 String packageRoot) { |
427 _packageRoot = packageRoot; | 427 _packageRoot = packageRoot; |
428 _exports = new ExportMap.parse(libraryList, packageRoot); | 428 _exports = new ExportMap.parse(libraryList, packageRoot); |
429 var librariesToAnalyze = _exports.allExportedFiles.toList(); | 429 var librariesToAnalyze = |
| 430 _exports.allExportedFiles |
| 431 .map((file) => new Uri.file(file).toString()) |
| 432 .toList(); |
430 librariesToAnalyze.addAll(libraryList.map((uri) => uri.toString())); | 433 librariesToAnalyze.addAll(libraryList.map((uri) => uri.toString())); |
431 | 434 |
432 // dart2js takes a String, but it expects that to be a Uri, not a file | 435 // dart2js takes a String, but it expects that to be a Uri, not a file |
433 // system path. | 436 // system path. |
434 libPath = path.toUri(libPath).toString(); | 437 libPath = path.toUri(libPath).toString(); |
435 | 438 |
436 if (packageRoot != null) { | 439 if (packageRoot != null) { |
437 packageRoot = path.toUri(packageRoot).toString(); | 440 packageRoot = path.toUri(packageRoot).toString(); |
438 } | 441 } |
439 | 442 |
(...skipping 1871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2311 return ''' | 2314 return ''' |
2312 <div class="mdn"> | 2315 <div class="mdn"> |
2313 $mdnComment | 2316 $mdnComment |
2314 <div class="mdn-note"><a href="$mdnUrl">from MDN</a></div> | 2317 <div class="mdn-note"><a href="$mdnUrl">from MDN</a></div> |
2315 </div> | 2318 </div> |
2316 '''; | 2319 '''; |
2317 } | 2320 } |
2318 | 2321 |
2319 String toString() => mdnComment; | 2322 String toString() => mdnComment; |
2320 } | 2323 } |
OLD | NEW |