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 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 } | 381 } |
382 } else if (node is dom.Text) { | 382 } else if (node is dom.Text) { |
383 String text = node.text; | 383 String text = node.text; |
384 write(text); | 384 write(text); |
385 } | 385 } |
386 } | 386 } |
387 } | 387 } |
388 | 388 |
389 @override | 389 @override |
390 void visitApi() { | 390 void visitApi() { |
391 definedTypes = api.types.keys.toSet(); | 391 Iterable<TypeDefinition> apiTypes = |
| 392 api.types.where((TypeDefinition td) => !td.experimental); |
| 393 definedTypes = apiTypes.map((TypeDefinition td) => td.name).toSet(); |
392 | 394 |
393 html(() { | 395 html(() { |
394 translateHtml(api.html); | 396 translateHtml(api.html); |
395 }); | 397 }); |
396 } | 398 } |
397 | 399 |
398 @override | 400 @override |
399 void visitDomain(Domain domain) { | 401 void visitDomain(Domain domain) { |
400 if (domain.experimental) { | 402 if (domain.experimental) { |
401 return; | 403 return; |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 showType('response', request.responseType, request.result); | 486 showType('response', request.responseType, request.result); |
485 }); | 487 }); |
486 translateHtml(request.html); | 488 translateHtml(request.html); |
487 describePayload(request.params, 'Parameters'); | 489 describePayload(request.params, 'Parameters'); |
488 describePayload(request.result, 'Returns'); | 490 describePayload(request.result, 'Returns'); |
489 }); | 491 }); |
490 } | 492 } |
491 | 493 |
492 @override | 494 @override |
493 void visitTypeDefinition(TypeDefinition typeDefinition) { | 495 void visitTypeDefinition(TypeDefinition typeDefinition) { |
| 496 if (typeDefinition.experimental) { |
| 497 return; |
| 498 } |
494 dt('typeDefinition', () { | 499 dt('typeDefinition', () { |
495 anchor('type_${typeDefinition.name}', () { | 500 anchor('type_${typeDefinition.name}', () { |
496 write('${typeDefinition.name}: '); | 501 write('${typeDefinition.name}: '); |
497 TypeVisitor typeVisitor = new TypeVisitor(api, short: true); | 502 TypeVisitor typeVisitor = new TypeVisitor(api, short: true); |
498 addAll(typeVisitor.collectHtml(() { | 503 addAll(typeVisitor.collectHtml(() { |
499 typeVisitor.visitTypeDecl(typeDefinition.type); | 504 typeVisitor.visitTypeDecl(typeDefinition.type); |
500 })); | 505 })); |
501 }); | 506 }); |
502 }); | 507 }); |
503 dd(() { | 508 dd(() { |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
702 bool verticalBarNeeded = false; | 707 bool verticalBarNeeded = false; |
703 for (TypeDecl choice in typeUnion.choices) { | 708 for (TypeDecl choice in typeUnion.choices) { |
704 if (verticalBarNeeded) { | 709 if (verticalBarNeeded) { |
705 write(' | '); | 710 write(' | '); |
706 } | 711 } |
707 visitTypeDecl(choice); | 712 visitTypeDecl(choice); |
708 verticalBarNeeded = true; | 713 verticalBarNeeded = true; |
709 } | 714 } |
710 } | 715 } |
711 } | 716 } |
OLD | NEW |