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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 '''.trim(); |
83 | 83 |
84 final GeneratedFile target = new GeneratedFile('../../doc/api.html', () { | 84 final GeneratedFile target = new GeneratedFile('../../doc/api.html', () { |
85 ToHtmlVisitor visitor = new ToHtmlVisitor(readApi()); | 85 ToHtmlVisitor visitor = new ToHtmlVisitor(readApi()); |
86 dom.Document document = new dom.Document(); | 86 dom.Document document = new dom.Document(); |
| 87 document.append(new dom.DocumentType('html', null, null)); |
87 for (dom.Node node in visitor.collectHtml(visitor.visitApi)) { | 88 for (dom.Node node in visitor.collectHtml(visitor.visitApi)) { |
88 document.append(node); | 89 document.append(node); |
89 } | 90 } |
90 return document.outerHtml; | 91 return document.outerHtml; |
91 }); | 92 }); |
92 | 93 |
93 /** | 94 /** |
94 * Translate spec_input.html into api.html. | 95 * Translate spec_input.html into api.html. |
95 */ | 96 */ |
96 main() { | 97 main() { |
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
701 bool verticalBarNeeded = false; | 702 bool verticalBarNeeded = false; |
702 for (TypeDecl choice in typeUnion.choices) { | 703 for (TypeDecl choice in typeUnion.choices) { |
703 if (verticalBarNeeded) { | 704 if (verticalBarNeeded) { |
704 write(' | '); | 705 write(' | '); |
705 } | 706 } |
706 visitTypeDecl(choice); | 707 visitTypeDecl(choice); |
707 verticalBarNeeded = true; | 708 verticalBarNeeded = true; |
708 } | 709 } |
709 } | 710 } |
710 } | 711 } |
OLD | NEW |