| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 outputDir); | 94 outputDir); |
| 95 | 95 |
| 96 var files = new VMFileSystem(); | 96 var files = new VMFileSystem(); |
| 97 parseOptions(frogPath, ['', '', '--libdir=$frogPath/lib'], files); | 97 parseOptions(frogPath, ['', '', '--libdir=$frogPath/lib'], files); |
| 98 initializeWorld(files); | 98 initializeWorld(files); |
| 99 | 99 |
| 100 print('Parsing MDN data...'); | 100 print('Parsing MDN data...'); |
| 101 final mdnFile = new File('${doc.scriptDir}/mdn/database.json'); | 101 final mdnFile = new File('${doc.scriptDir}/mdn/database.json'); |
| 102 final mdn = JSON.parse(mdnFile.readAsTextSync()); | 102 final mdn = JSON.parse(mdnFile.readAsTextSync()); |
| 103 | 103 |
| 104 print('Cross-referencing dart:dom and dart:html...'); | 104 print('Cross-referencing dart:html...'); |
| 105 HtmlDiff.initialize(); | 105 HtmlDiff.initialize(); |
| 106 _diff = new HtmlDiff(printWarnings:false); | 106 _diff = new HtmlDiff(printWarnings:false); |
| 107 _diff.run(); | 107 _diff.run(); |
| 108 world.reset(); | 108 world.reset(); |
| 109 | 109 |
| 110 // Add all of the core libraries. | 110 // Add all of the core libraries. |
| 111 world.getOrAddLibrary('dart:core'); | 111 world.getOrAddLibrary('dart:core'); |
| 112 world.getOrAddLibrary('dart:coreimpl'); | 112 world.getOrAddLibrary('dart:coreimpl'); |
| 113 world.getOrAddLibrary('dart:json'); | 113 world.getOrAddLibrary('dart:json'); |
| 114 world.getOrAddLibrary('dart:dom'); | |
| 115 world.getOrAddLibrary('dart:html'); | 114 world.getOrAddLibrary('dart:html'); |
| 116 world.getOrAddLibrary('dart:io'); | 115 world.getOrAddLibrary('dart:io'); |
| 117 world.getOrAddLibrary('dart:isolate'); | 116 world.getOrAddLibrary('dart:isolate'); |
| 118 world.getOrAddLibrary('dart:uri'); | 117 world.getOrAddLibrary('dart:uri'); |
| 119 world.getOrAddLibrary('dart:utf'); | 118 world.getOrAddLibrary('dart:utf'); |
| 120 world.process(); | 119 world.process(); |
| 121 | 120 |
| 122 print('Generating docs...'); | 121 print('Generating docs...'); |
| 123 final apidoc = new Apidoc(mdn, outputDir, mode, generateAppCache); | 122 final apidoc = new Apidoc(mdn, outputDir, mode, generateAppCache); |
| 124 | 123 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 /** Override definition from parent class to strip out annotation tags. */ | 248 /** Override definition from parent class to strip out annotation tags. */ |
| 250 String commentToHtml(String comment) { | 249 String commentToHtml(String comment) { |
| 251 return super.commentToHtml( | 250 return super.commentToHtml( |
| 252 comment.replaceAll(const RegExp("@([a-zA-Z]+) ([^;]+)(?:;|\$)"), '')); | 251 comment.replaceAll(const RegExp("@([a-zA-Z]+) ([^;]+)(?:;|\$)"), '')); |
| 253 } | 252 } |
| 254 | 253 |
| 255 String getTypeComment(Type type) { | 254 String getTypeComment(Type type) { |
| 256 return _mergeDocs( | 255 return _mergeDocs( |
| 257 includeMdnTypeComment(type), | 256 includeMdnTypeComment(type), |
| 258 super.getTypeComment(type), | 257 super.getTypeComment(type), |
| 259 getTypeDoc(type)); | 258 /* getTypeDoc(type) */ null); |
| 260 } | 259 } |
| 261 | 260 |
| 262 String getMethodComment(MethodMember method) { | 261 String getMethodComment(MethodMember method) { |
| 263 // TODO(rnystrom): Disabling cross-linking between individual members. | 262 // TODO(rnystrom): Disabling cross-linking between individual members. |
| 264 // Now that we include MDN content for most members, it doesn't add much | 263 // Now that we include MDN content for most members, it doesn't add much |
| 265 // value and adds a lot of clutter. Once we're sure we want to do this, | 264 // value and adds a lot of clutter. Once we're sure we want to do this, |
| 266 // we can delete this code entirely. | 265 // we can delete this code entirely. |
| 267 return _mergeDocs( | 266 return _mergeDocs( |
| 268 includeMdnMemberComment(method), | 267 includeMdnMemberComment(method), |
| 269 super.getMethodComment(method), | 268 super.getMethodComment(method), |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 506 ''' | 505 ''' |
| 507 <p class="correspond">This corresponds to $domTypesText in the | 506 <p class="correspond">This corresponds to $domTypesText in the |
| 508 ${a("dom.html", "dart:dom")} library.</p> | 507 ${a("dom.html", "dart:dom")} library.</p> |
| 509 '''; | 508 '''; |
| 510 } | 509 } |
| 511 | 510 |
| 512 return ''; | 511 return ''; |
| 513 } | 512 } |
| 514 | 513 |
| 515 } | 514 } |
| OLD | NEW |