| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 * This generates the reference documentation for the core libraries that come | 6 * This generates the reference documentation for the core libraries that come |
| 7 * with dart. It is built on top of dartdoc, which is a general-purpose library | 7 * with dart. It is built on top of dartdoc, which is a general-purpose library |
| 8 * for generating docs from any Dart code. This library extends that to include | 8 * for generating docs from any Dart code. This library extends that to include |
| 9 * additional information and styling specific to our standard library. | 9 * additional information and styling specific to our standard library. |
| 10 * | 10 * |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 case '--generate-app-cache=true': | 54 case '--generate-app-cache=true': |
| 55 generateAppCache = true; | 55 generateAppCache = true; |
| 56 break; | 56 break; |
| 57 | 57 |
| 58 default: | 58 default: |
| 59 if (arg.startsWith('--exclude-lib=')) { | 59 if (arg.startsWith('--exclude-lib=')) { |
| 60 excludedLibraries.add(arg.substring('--exclude-lib='.length)); | 60 excludedLibraries.add(arg.substring('--exclude-lib='.length)); |
| 61 } else if (arg.startsWith('--include-lib=')) { | 61 } else if (arg.startsWith('--include-lib=')) { |
| 62 includedLibraries.add(arg.substring('--include-lib='.length)); | 62 includedLibraries.add(arg.substring('--include-lib='.length)); |
| 63 } else if (arg.startsWith('--out=')) { | 63 } else if (arg.startsWith('--out=')) { |
| 64 outputDir = new Path.fromNative(arg.substring('--out='.length)); | 64 outputDir = new Path(arg.substring('--out='.length)); |
| 65 } else if (arg.startsWith('--pkg=')) { | 65 } else if (arg.startsWith('--pkg=')) { |
| 66 pkgPath = arg.substring('--pkg='.length); | 66 pkgPath = arg.substring('--pkg='.length); |
| 67 } else { | 67 } else { |
| 68 print('Unknown option: $arg'); | 68 print('Unknown option: $arg'); |
| 69 return; | 69 return; |
| 70 } | 70 } |
| 71 break; | 71 break; |
| 72 } | 72 } |
| 73 } | 73 } |
| 74 | 74 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 // Add all of the core libraries. | 110 // Add all of the core libraries. |
| 111 final apidocLibraries = <Path>[]; | 111 final apidocLibraries = <Path>[]; |
| 112 LIBRARIES.forEach((String name, LibraryInfo info) { | 112 LIBRARIES.forEach((String name, LibraryInfo info) { |
| 113 if (info.documented) { | 113 if (info.documented) { |
| 114 apidocLibraries.add(new Path('dart:$name')); | 114 apidocLibraries.add(new Path('dart:$name')); |
| 115 } | 115 } |
| 116 }); | 116 }); |
| 117 | 117 |
| 118 var lister = new Directory.fromPath(doc.scriptDir.append('../../pkg')).list(); | 118 var lister = new Directory.fromPath(doc.scriptDir.append('../../pkg')).list(); |
| 119 lister.onDir = (dirPath) { | 119 lister.onDir = (dirPath) { |
| 120 var path = new Path.fromNative(dirPath); | 120 var path = new Path(dirPath); |
| 121 var libName = path.filename; | 121 var libName = path.filename; |
| 122 | 122 |
| 123 // TODO(rnystrom): Get rid of oldStylePath support when all packages are | 123 // TODO(rnystrom): Get rid of oldStylePath support when all packages are |
| 124 // using new layout. See #5106. | 124 // using new layout. See #5106. |
| 125 var oldStylePath = path.append('${libName}.dart'); | 125 var oldStylePath = path.append('${libName}.dart'); |
| 126 var newStylePath = path.append('lib/${libName}.dart'); | 126 var newStylePath = path.append('lib/${libName}.dart'); |
| 127 | 127 |
| 128 if (new File.fromPath(oldStylePath).existsSync()) { | 128 if (new File.fromPath(oldStylePath).existsSync()) { |
| 129 apidocLibraries.add(oldStylePath); | 129 apidocLibraries.add(oldStylePath); |
| 130 includedLibraries.add(libName); | 130 includedLibraries.add(libName); |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 return ''' | 589 return ''' |
| 590 <div class="mdn"> | 590 <div class="mdn"> |
| 591 $mdnComment | 591 $mdnComment |
| 592 <div class="mdn-note"><a href="$mdnUrl">from MDN</a></div> | 592 <div class="mdn-note"><a href="$mdnUrl">from MDN</a></div> |
| 593 </div> | 593 </div> |
| 594 '''; | 594 '''; |
| 595 } | 595 } |
| 596 | 596 |
| 597 String toString() => mdnComment; | 597 String toString() => mdnComment; |
| 598 } | 598 } |
| OLD | NEW |