Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Side by Side Diff: utils/apidoc/apidoc.dart

Issue 10389097: Move dart:dom to dart:dom_deprecated (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes from review Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/isolate/v2_compute_this_script_browser_test.dart ('k') | utils/apidoc/html_diff.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 436 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 // Only print setters if the getter doesn't exist. 447 // Only print setters if the getter doesn't exist.
448 return members.filter((m) { 448 return members.filter((m) {
449 if (!m.name.startsWith('set:')) return true; 449 if (!m.name.startsWith('set:')) return true;
450 var getName = m.name.replaceFirst('set:', 'get:'); 450 var getName = m.name.replaceFirst('set:', 'get:');
451 return !members.some((maybeGet) => maybeGet.name == getName); 451 return !members.some((maybeGet) => maybeGet.name == getName);
452 }); 452 });
453 } 453 }
454 454
455 /** 455 /**
456 * Returns additional documentation for [member], linking it to the 456 * Returns additional documentation for [member], linking it to the
457 * corresponding `dart:html` or `dart:dom` [Member](s). If [member] is not in 457 * corresponding `dart:html` or `dart:dom_deprecated`
458 * `dart:html` or `dart:dom`, returns no additional documentation. 458 * [Member](s). If [member] is not in `dart:html` or
459 * `dart:dom_deprecated`, returns no additional documentation.
459 */ 460 */
460 String getMemberDoc(Member member) { 461 String getMemberDoc(Member member) {
461 if (_diff.domToHtml.containsKey(member)) { 462 if (_diff.domToHtml.containsKey(member)) {
462 final htmlMemberSet = _unifyProperties(_diff.domToHtml[member]); 463 final htmlMemberSet = _unifyProperties(_diff.domToHtml[member]);
463 final allSameName = htmlMemberSet.every((m) => _diff.sameName(member, m)); 464 final allSameName = htmlMemberSet.every((m) => _diff.sameName(member, m));
464 final phrase = allSameName ? 'available as' : 'renamed to'; 465 final phrase = allSameName ? 'available as' : 'renamed to';
465 final htmlMembers = doc.joinWithCommas(map(htmlMemberSet, _linkMember)); 466 final htmlMembers = doc.joinWithCommas(map(htmlMemberSet, _linkMember));
466 return 467 return
467 '''<p class="correspond">This is $phrase $htmlMembers in the 468 '''<p class="correspond">This is $phrase $htmlMembers in the
468 ${a("html.html", "dart:html")} library.</p> 469 ${a("html.html", "dart:html")} library.</p>
469 '''; 470 ''';
470 } else if (_diff.htmlToDom.containsKey(member)) { 471 } else if (_diff.htmlToDom.containsKey(member)) {
471 final domMemberSet = _unifyProperties(_diff.htmlToDom[member]); 472 final domMemberSet = _unifyProperties(_diff.htmlToDom[member]);
472 final allSameName = domMemberSet.every((m) => _diff.sameName(m, member)); 473 final allSameName = domMemberSet.every((m) => _diff.sameName(m, member));
473 final phrase = allSameName ? 'is the same as' : 'renames'; 474 final phrase = allSameName ? 'is the same as' : 'renames';
474 final domMembers = doc.joinWithCommas(map(domMemberSet, _linkMember)); 475 final domMembers = doc.joinWithCommas(map(domMemberSet, _linkMember));
475 return 476 return
476 ''' 477 '''
477 <p class="correspond">This $phrase $domMembers in the 478 <p class="correspond">This $phrase $domMembers in the
478 ${a("dom.html", "dart:dom")} library.</p> 479 ${a("dom.html", "dart:dom_deprecated")} library.</p>
479 '''; 480 ''';
480 } else { 481 } else {
481 return ''; 482 return '';
482 } 483 }
483 } 484 }
484 485
485 /** 486 /**
486 * Returns additional Markdown-formatted documentation for [type], linking it 487 * Returns additional Markdown-formatted documentation for [type],
487 * to the corresponding `dart:html` or `dart:dom` [Type](s). If [type] is not 488 * linking it to the corresponding `dart:html` or
488 * in `dart:html` or `dart:dom`, returns no additional documentation. 489 * `dart:dom_deprecated` [Type](s). If [type] is not in `dart:html`
490 * or `dart:dom_deprecated`, returns no additional documentation.
489 */ 491 */
490 String getTypeDoc(Type type) { 492 String getTypeDoc(Type type) {
491 final htmlTypes = _diff.domTypesToHtml[type]; 493 final htmlTypes = _diff.domTypesToHtml[type];
492 if ((htmlTypes != null) && (htmlTypes.length > 0)) { 494 if ((htmlTypes != null) && (htmlTypes.length > 0)) {
493 var htmlTypesText = doc.joinWithCommas(map(htmlTypes, typeReference)); 495 var htmlTypesText = doc.joinWithCommas(map(htmlTypes, typeReference));
494 return 496 return
495 ''' 497 '''
496 <p class="correspond">This corresponds to $htmlTypesText in the 498 <p class="correspond">This corresponds to $htmlTypesText in the
497 ${a("html.html", "dart:html")} library.</p> 499 ${a("html.html", "dart:html")} library.</p>
498 '''; 500 ''';
499 } 501 }
500 502
501 final domTypes = _diff.htmlTypesToDom[type]; 503 final domTypes = _diff.htmlTypesToDom[type];
502 if ((domTypes != null) && (domTypes.length > 0)) { 504 if ((domTypes != null) && (domTypes.length > 0)) {
503 var domTypesText = doc.joinWithCommas(map(domTypes, typeReference)); 505 var domTypesText = doc.joinWithCommas(map(domTypes, typeReference));
504 return 506 return
505 ''' 507 '''
506 <p class="correspond">This corresponds to $domTypesText in the 508 <p class="correspond">This corresponds to $domTypesText in the
507 ${a("dom.html", "dart:dom")} library.</p> 509 ${a("dom.html", "dart:dom_deprecated")} library.</p>
508 '''; 510 ''';
509 } 511 }
510 512
511 return ''; 513 return '';
512 } 514 }
513 515
514 } 516 }
OLDNEW
« no previous file with comments | « tests/isolate/v2_compute_this_script_browser_test.dart ('k') | utils/apidoc/html_diff.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698