| 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 * |
| 11 * Usage: | 11 * Usage: |
| 12 * | 12 * |
| 13 * $ dart apidoc.dart [--out=<output directory>] | 13 * $ dart apidoc.dart [--out=<output directory>] |
| 14 */ | 14 */ |
| 15 library apidoc; | 15 library apidoc; |
| 16 | 16 |
| 17 import 'dart:async'; | 17 import 'dart:async'; |
| 18 import 'dart:convert'; | 18 import 'dart:convert'; |
| 19 import 'dart:io'; | 19 import 'dart:io'; |
| 20 | 20 |
| 21 import 'html_diff.dart'; | 21 import 'html_diff.dart'; |
| 22 | 22 |
| 23 // TODO(rnystrom): Use "package:" URL (#4968). | 23 import 'package:compiler/src/mirrors/source_mirrors.dart'; |
| 24 import '../../pkg/compiler/lib/src/mirrors/source_mirrors.dart'; | 24 import 'package:compiler/src/mirrors/mirrors_util.dart'; |
| 25 import '../../pkg/compiler/lib/src/mirrors/mirrors_util.dart'; | 25 import 'package:compiler/src/filenames.dart'; |
| 26 import '../../pkg/compiler/lib/src/filenames.dart'; | 26 import 'package:dartdoc/dartdoc.dart'; |
| 27 import '../../sdk/lib/_internal/dartdoc/lib/dartdoc.dart'; | 27 import 'package:sdk_library_metadata/libraries.dart'; |
| 28 import '../../sdk/lib/_internal/libraries.dart'; | |
| 29 import 'package:path/path.dart' as path; | 28 import 'package:path/path.dart' as path; |
| 30 | 29 |
| 31 HtmlDiff _diff; | 30 HtmlDiff _diff; |
| 32 | 31 |
| 33 void main(List<String> args) { | 32 void main(List<String> args) { |
| 34 int mode = MODE_STATIC; | 33 int mode = MODE_STATIC; |
| 35 String outputDir = 'docs'; | 34 String outputDir = 'docs'; |
| 36 bool generateAppCache = false; | 35 bool generateAppCache = false; |
| 37 | 36 |
| 38 List<String> excludedLibraries = <String>[]; | 37 List<String> excludedLibraries = <String>[]; |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 var memberName = '$typeName.${member.simpleName}'; | 468 var memberName = '$typeName.${member.simpleName}'; |
| 470 if (member is MethodMirror && member.isConstructor) { | 469 if (member is MethodMirror && member.isConstructor) { |
| 471 final separator = member.constructorName == '' ? '' : '.'; | 470 final separator = member.constructorName == '' ? '' : '.'; |
| 472 memberName = 'new $typeName$separator${member.constructorName}'; | 471 memberName = 'new $typeName$separator${member.constructorName}'; |
| 473 } | 472 } |
| 474 | 473 |
| 475 return a(memberUrl(member), memberName); | 474 return a(memberUrl(member), memberName); |
| 476 } | 475 } |
| 477 } | 476 } |
| 478 | 477 |
| OLD | NEW |