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 import 'dart:convert'; | 10 import 'dart:convert'; |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 -webkit-margin-before: 0; | 122 -webkit-margin-before: 0; |
123 -webkit-margin-start: 0; | 123 -webkit-margin-start: 0; |
124 -webkit-padding-start: 0; | 124 -webkit-padding-start: 0; |
125 | 125 |
126 list-style-type: none; | 126 list-style-type: none; |
127 } | 127 } |
128 ''' | 128 ''' |
129 .trim(); | 129 .trim(); |
130 | 130 |
131 final GeneratedFile target = | 131 final GeneratedFile target = |
132 new GeneratedFile('doc/api.html', (String pkgPath) { | 132 new GeneratedFile('doc/api.html', (String pkgPath) async { |
133 ToHtmlVisitor visitor = new ToHtmlVisitor(readApi(pkgPath)); | 133 ToHtmlVisitor visitor = new ToHtmlVisitor(readApi(pkgPath)); |
134 dom.Document document = new dom.Document(); | 134 dom.Document document = new dom.Document(); |
135 document.append(new dom.DocumentType('html', null, null)); | 135 document.append(new dom.DocumentType('html', null, null)); |
136 for (dom.Node node in visitor.collectHtml(visitor.visitApi)) { | 136 for (dom.Node node in visitor.collectHtml(visitor.visitApi)) { |
137 document.append(node); | 137 document.append(node); |
138 } | 138 } |
139 return document.outerHtml; | 139 return document.outerHtml; |
140 }); | 140 }); |
141 | 141 |
142 String _toTitleCase(String str) { | 142 String _toTitleCase(String str) { |
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
822 bool verticalBarNeeded = false; | 822 bool verticalBarNeeded = false; |
823 for (TypeDecl choice in typeUnion.choices) { | 823 for (TypeDecl choice in typeUnion.choices) { |
824 if (verticalBarNeeded) { | 824 if (verticalBarNeeded) { |
825 write(' | '); | 825 write(' | '); |
826 } | 826 } |
827 visitTypeDecl(choice); | 827 visitTypeDecl(choice); |
828 verticalBarNeeded = true; | 828 verticalBarNeeded = true; |
829 } | 829 } |
830 } | 830 } |
831 } | 831 } |
OLD | NEW |