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

Side by Side Diff: pkg/analysis_server/tool/spec/to_html.dart

Issue 469543002: Add a test to verify that analysis server code generation is up to date. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove unused imports Created 6 years, 4 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 | « pkg/analysis_server/tool/spec/generate_files ('k') | no next file » | 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) 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;
11 11
12 import 'dart:convert'; 12 import 'dart:convert';
13 import 'dart:io';
14 13
15 import 'package:html5lib/dom.dart' as dom; 14 import 'package:html5lib/dom.dart' as dom;
16 15
17 import 'api.dart'; 16 import 'api.dart';
18 import 'codegen_tools.dart'; 17 import 'codegen_tools.dart';
19 import 'from_html.dart'; 18 import 'from_html.dart';
20 import 'html_tools.dart'; 19 import 'html_tools.dart';
21 20
22 /** 21 /**
23 * Embedded stylesheet 22 * Embedded stylesheet
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 dd(() { 521 dd(() {
523 translateHtml(typeObjectField.html); 522 translateHtml(typeObjectField.html);
524 }); 523 });
525 } 524 }
526 525
527 @override 526 @override
528 void visitTypeReference(TypeReference typeReference) { 527 void visitTypeReference(TypeReference typeReference) {
529 } 528 }
530 } 529 }
531 530
531 final GeneratedFile target = new GeneratedFile('../../doc/api.html', () {
532 ToHtmlVisitor visitor = new ToHtmlVisitor(readApi());
533 dom.Document document = new dom.Document();
534 for (dom.Node node in visitor.collectHtml(visitor.visitApi)) {
535 document.append(node);
536 }
537 return document.outerHtml;
538 });
539
532 /** 540 /**
533 * Translate spec_input.html into api.html. 541 * Translate spec_input.html into api.html.
534 */ 542 */
535 main() { 543 main() {
536 ToHtmlVisitor visitor = new ToHtmlVisitor(readApi()); 544 target.generate();
537 dom.Document document = new dom.Document();
538 for (dom.Node node in visitor.collectHtml(visitor.visitApi)) {
539 document.append(node);
540 }
541 File outputFile = new File('../../doc/api.html');
542 outputFile.writeAsStringSync(document.outerHtml);
543 } 545 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/tool/spec/generate_files ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698