| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 print('Parsing MDN data...'); | 75 print('Parsing MDN data...'); |
| 76 final mdnFile = new File.fromPath(doc.scriptDir.append('mdn/database.json')); | 76 final mdnFile = new File.fromPath(doc.scriptDir.append('mdn/database.json')); |
| 77 final mdn = JSON.parse(mdnFile.readAsTextSync()); | 77 final mdn = JSON.parse(mdnFile.readAsTextSync()); |
| 78 | 78 |
| 79 print('Cross-referencing dart:html...'); | 79 print('Cross-referencing dart:html...'); |
| 80 HtmlDiff.initialize(doc.libPath); | 80 HtmlDiff.initialize(doc.libPath); |
| 81 _diff = new HtmlDiff(printWarnings:false); | 81 _diff = new HtmlDiff(printWarnings:false); |
| 82 _diff.run(); | 82 _diff.run(); |
| 83 | 83 |
| 84 // Process handwritten HTML documentation. | 84 // Process handwritten HTML documentation. |
| 85 print('Processing handwritten HTML documentation...'); |
| 85 final htmldoc = new Htmldoc(); | 86 final htmldoc = new Htmldoc(); |
| 87 htmldoc.includeApi = true; |
| 86 htmldoc.documentLibraries( | 88 htmldoc.documentLibraries( |
| 87 <Path>[doc.scriptDir.append('../../lib/html/doc/html.dartdoc')], | 89 <Path>[doc.scriptDir.append('../../lib/html/doc/html.dartdoc')], |
| 88 doc.libPath); | 90 doc.libPath); |
| 89 print('Processing handwritten HTML documentation...'); | |
| 90 | 91 |
| 91 // Process libraries. | 92 // Process libraries. |
| 92 | 93 |
| 93 // TODO(johnniwinther): Libraries for the compilation seem to be more like | 94 // TODO(johnniwinther): Libraries for the compilation seem to be more like |
| 94 // URIs. Perhaps Path should have a toURI() method. | 95 // URIs. Perhaps Path should have a toURI() method. |
| 95 // Add all of the core libraries. | 96 // Add all of the core libraries. |
| 96 final apidocLibraries = <Path>[]; | 97 final apidocLibraries = <Path>[]; |
| 97 LIBRARIES.forEach((String name, LibraryInfo info) { | 98 LIBRARIES.forEach((String name, LibraryInfo info) { |
| 98 if (info.documented) { | 99 if (info.documented) { |
| 99 apidocLibraries.add(new Path('dart:$name')); | 100 apidocLibraries.add(new Path('dart:$name')); |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 final typeName = member.surroundingDeclaration.simpleName; | 549 final typeName = member.surroundingDeclaration.simpleName; |
| 549 var memberName = '$typeName.${member.simpleName}'; | 550 var memberName = '$typeName.${member.simpleName}'; |
| 550 if (member is MethodMirror && (member.isConstructor || member.isFactory)) { | 551 if (member is MethodMirror && (member.isConstructor || member.isFactory)) { |
| 551 final separator = member.constructorName == '' ? '' : '.'; | 552 final separator = member.constructorName == '' ? '' : '.'; |
| 552 memberName = 'new $typeName$separator${member.constructorName}'; | 553 memberName = 'new $typeName$separator${member.constructorName}'; |
| 553 } | 554 } |
| 554 | 555 |
| 555 return a(memberUrl(member), memberName); | 556 return a(memberUrl(member), memberName); |
| 556 } | 557 } |
| 557 } | 558 } |
| OLD | NEW |