| 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 |
| 15 #library('apidoc'); | 16 #library('apidoc'); |
| 16 | 17 |
| 17 #import('dart:io'); | 18 #import('dart:io'); |
| 18 #import('dart:json'); | 19 #import('dart:json'); |
| 19 #import('html_diff.dart'); | 20 #import('html_diff.dart'); |
| 21 |
| 20 #import('../../frog/lang.dart'); | 22 #import('../../frog/lang.dart'); |
| 21 #import('../../frog/file_system_vm.dart'); | 23 #import('../../frog/file_system_vm.dart'); |
| 22 #import('../../frog/file_system.dart'); | 24 #import('../../frog/file_system.dart'); |
| 23 #import('../../lib/dartdoc/dartdoc.dart', prefix: 'doc'); | 25 #import('../../lib/dartdoc/dartdoc.dart', prefix: 'doc'); |
| 24 | 26 |
| 25 HtmlDiff _diff; | 27 HtmlDiff _diff; |
| 26 | 28 |
| 27 final GET_PREFIX = 'get:'; | 29 final GET_PREFIX = 'get:'; |
| 28 | 30 |
| 29 void main() { | 31 void main() { |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 super.docLibraryNavigationJson(library, libraries); | 223 super.docLibraryNavigationJson(library, libraries); |
| 222 } | 224 } |
| 223 | 225 |
| 224 void docLibrary(Library library) { | 226 void docLibrary(Library library) { |
| 225 // TODO(rnystrom): Hackish. The IO libraries reference this but we don't | 227 // TODO(rnystrom): Hackish. The IO libraries reference this but we don't |
| 226 // want it in the docs. | 228 // want it in the docs. |
| 227 if (library.name == 'dart:nativewrappers') return; | 229 if (library.name == 'dart:nativewrappers') return; |
| 228 super.docLibrary(library); | 230 super.docLibrary(library); |
| 229 } | 231 } |
| 230 | 232 |
| 233 /** Override definition from parent class to strip out annotation tags. */ |
| 234 String commentToHtml(String comment) { |
| 235 return super.commentToHtml( |
| 236 comment.replaceAll(const RegExp("@([a-zA-Z]+) ([^;]+)(?:;|\$)"), '')); |
| 237 } |
| 238 |
| 231 String getTypeComment(Type type) { | 239 String getTypeComment(Type type) { |
| 232 return _mergeDocs( | 240 return _mergeDocs( |
| 233 includeMdnTypeComment(type), | 241 includeMdnTypeComment(type), |
| 234 super.getTypeComment(type), | 242 super.getTypeComment(type), |
| 235 getTypeDoc(type)); | 243 getTypeDoc(type)); |
| 236 } | 244 } |
| 237 | 245 |
| 238 String getMethodComment(MethodMember method) { | 246 String getMethodComment(MethodMember method) { |
| 239 // TODO(rnystrom): Disabling cross-linking between individual members. | 247 // TODO(rnystrom): Disabling cross-linking between individual members. |
| 240 // Now that we include MDN content for most members, it doesn't add much | 248 // Now that we include MDN content for most members, it doesn't add much |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 return | 489 return |
| 482 ''' | 490 ''' |
| 483 <p class="correspond">This corresponds to $domTypesText in the | 491 <p class="correspond">This corresponds to $domTypesText in the |
| 484 ${a("dom.html", "dart:dom")} library.</p> | 492 ${a("dom.html", "dart:dom")} library.</p> |
| 485 '''; | 493 '''; |
| 486 } | 494 } |
| 487 | 495 |
| 488 return ''; | 496 return ''; |
| 489 } | 497 } |
| 490 } | 498 } |
| OLD | NEW |