| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 * Code for displaying the API as HTML. This is used both for generating a | 6 * Code for displaying the API as HTML. This is used both for generating a |
| 7 * full description of the API as a web page, and for generating doc comments | 7 * full description of the API as a web page, and for generating doc comments |
| 8 * in generated code. | 8 * in generated code. |
| 9 */ | 9 */ |
| 10 library to.html; | 10 library to.html; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 .subindex ul { | 72 .subindex ul { |
| 73 padding-left: 0px; | 73 padding-left: 0px; |
| 74 margin-left: 0px; | 74 margin-left: 0px; |
| 75 | 75 |
| 76 -webkit-margin-before: 0px; | 76 -webkit-margin-before: 0px; |
| 77 -webkit-margin-start: 0px; | 77 -webkit-margin-start: 0px; |
| 78 -webkit-padding-start: 0px; | 78 -webkit-padding-start: 0px; |
| 79 | 79 |
| 80 list-style-type: none; | 80 list-style-type: none; |
| 81 } | 81 } |
| 82 '''.trim(); | 82 ''' |
| 83 .trim(); |
| 83 | 84 |
| 84 final GeneratedFile target = | 85 final GeneratedFile target = |
| 85 new GeneratedFile('doc/api.html', (String pkgPath) { | 86 new GeneratedFile('doc/api.html', (String pkgPath) { |
| 86 ToHtmlVisitor visitor = new ToHtmlVisitor(readApi(pkgPath)); | 87 ToHtmlVisitor visitor = new ToHtmlVisitor(readApi(pkgPath)); |
| 87 dom.Document document = new dom.Document(); | 88 dom.Document document = new dom.Document(); |
| 88 document.append(new dom.DocumentType('html', null, null)); | 89 document.append(new dom.DocumentType('html', null, null)); |
| 89 for (dom.Node node in visitor.collectHtml(visitor.visitApi)) { | 90 for (dom.Node node in visitor.collectHtml(visitor.visitApi)) { |
| 90 document.append(node); | 91 document.append(node); |
| 91 } | 92 } |
| 92 return document.outerHtml; | 93 return document.outerHtml; |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 dd(() { | 442 dd(() { |
| 442 box(() { | 443 box(() { |
| 443 showType( | 444 showType( |
| 444 'notification', notification.notificationType, notification.params); | 445 'notification', notification.notificationType, notification.params); |
| 445 }); | 446 }); |
| 446 translateHtml(notification.html); | 447 translateHtml(notification.html); |
| 447 describePayload(notification.params, 'Parameters'); | 448 describePayload(notification.params, 'Parameters'); |
| 448 }); | 449 }); |
| 449 } | 450 } |
| 450 | 451 |
| 451 @override visitRefactoring(Refactoring refactoring) { | 452 @override |
| 453 visitRefactoring(Refactoring refactoring) { |
| 452 dt('refactoring', () { | 454 dt('refactoring', () { |
| 453 write(refactoring.kind); | 455 write(refactoring.kind); |
| 454 }); | 456 }); |
| 455 dd(() { | 457 dd(() { |
| 456 translateHtml(refactoring.html); | 458 translateHtml(refactoring.html); |
| 457 describePayload(refactoring.feedback, 'Feedback', force: true); | 459 describePayload(refactoring.feedback, 'Feedback', force: true); |
| 458 describePayload(refactoring.options, 'Options', force: true); | 460 describePayload(refactoring.options, 'Options', force: true); |
| 459 }); | 461 }); |
| 460 } | 462 } |
| 461 | 463 |
| (...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 707 bool verticalBarNeeded = false; | 709 bool verticalBarNeeded = false; |
| 708 for (TypeDecl choice in typeUnion.choices) { | 710 for (TypeDecl choice in typeUnion.choices) { |
| 709 if (verticalBarNeeded) { | 711 if (verticalBarNeeded) { |
| 710 write(' | '); | 712 write(' | '); |
| 711 } | 713 } |
| 712 visitTypeDecl(choice); | 714 visitTypeDecl(choice); |
| 713 verticalBarNeeded = true; | 715 verticalBarNeeded = true; |
| 714 } | 716 } |
| 715 } | 717 } |
| 716 } | 718 } |
| OLD | NEW |