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

Side by Side Diff: client/web/doc_link.html

Issue 11636011: Web components based app to view dart docs. Still has rough edges. (Closed) Base URL: https://github.com/dart-lang/dart-api-app.git@master
Patch Set: more fixes Created 7 years, 11 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
« no previous file with comments | « client/web/ast.dart ('k') | client/web/element_summary.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html><body> 2 <html><body>
3 <element name="x-doc-link" constructor="DocLink" extends="span"> 3 <element name="x-doc-link" extends="span">
4 <template> 4 <template>
5 <template instantiate="if ref.refId != 'void'"> 5 <template instantiate="if ref.refId != 'void'">
6 <a href="{{permalink(ref)}}">{{ref.name}}</a> 6 <a href="{{permalink(ref)}}">
7 <template instantiate="if short">
8 {{ref.name}}
9 </template>
10 <template instantiate="if !short">
11 {{ref.shortDescription}}
12 </template>
13 </a>
7 </template> 14 </template>
8 <template instantiate="if ref.refId == 'void'"> 15 <template instantiate="if ref.refId == 'void'">
9 {{ref.name}} 16 {{ref.name}}
10 </template> 17 </template>
11 </template> 18 </template>
12 <script type="application/dart"> 19 <script type="application/dart">
13 import 'package:web_ui/web_ui.dart'; 20 import 'package:web_ui/web_ui.dart';
14 import 'ast.dart'; 21 import 'ast.dart';
15 import 'model.dart'; 22 import 'model.dart';
16 23
17 class DocLink extends WebComponent { 24 class DocLink extends WebComponent {
18 /// Must be a Reference or Element. 25 /** Must be a Reference or Element. */
19 var ref; 26 var ref;
27 /** Whether a short version of the Element name should be used. */
28 bool short = false;
20 } 29 }
21 </script> 30 </script>
22 </element> 31 </element>
23
24 <element name="x-member-blocks" constructor="MemberBlocks" extends="div">
25 <template>
26 <template iterate='block in blocks'>
27 <div>
28 <h3>{{block.kindTitle}}</h3>
29 <ul>
30 <template iterate='element in block.elements'>
31 <li class="{{kindCssClass(element)}}">
32 <x-element-summary element="{{element}}"></x-element-summary>
33 </li>
34 </template>
35 </ul>
36 </div>
37 </template>
38 </template>
39 <script type="application/dart">
40 // TODO(jacobr): this is kinda a rediculous way to do this
41 import 'package:web_ui/web_ui.dart';
42 import 'ast.dart';
43 import 'model.dart';
44
45 class MemberBlocks extends WebComponent {
46 List<ElementBlock> blocks;
47 }
48 </script>
49 </element>
50
51 <element name="x-element-signature" constructor="ElementSignature" extends="sp an">
52 <template>
53 <span class="element-class">
54 <template instantiate="if (element is MethodElementBase || element is Ty pedefElement) && element.returnType != null">
55 <x-doc-link ref="{{element.returnType}}"></x-doc-link>
56 </template>
57 </span>
58 <span class="element-definition">
59 <span class="element-name"><x-doc-link ref="{{element}}"></x-doc-link></ span>
60 <template instantiate="if element is MethodElement || element is Constru ctorElement || element is TypedefElement">
61 <span class="args">(
62 <template iterate="param in element.parameters">
63 <span class="arg">
64 <template instantiate="if param.type != null">
65 <span class = "arg-type">
66 <x-doc-link ref="{{param.type}}"></x-doc-link>
67 </span>
68 </template>
69 <span class="arg-name">{{param.name}}</span>
70 </span>
71 </template>)
72 </span>
73 </template>
74 </span>
75 </template>
76 <script type="application/dart">
77 import 'package:web_ui/web_ui.dart';
78 import 'ast.dart';
79 import 'model.dart';
80
81 class ElementSignature extends WebComponent {
82 Element element;
83 }
84 </script>
85 </element>
86
87 <element name="x-element-summary" constructor="ElementSummary" extends="div">
88 <template>
89 <!--TODO(jacobr): use id instead of data-id and use a different escaping s cheme-->
90 <details class="element-details {{(element is MethodElementBase) ? 'member -details' : 'type-details'}}" data-id="{{element.id}}" open="{{currentMember != null && element.id == currentMember.id}}">
91 <summary>
92 <div class="overflow-shadow"></div>
93 <template instantiate="if element is! ClassElement">
94 <x-element-signature element="{{element}}">
95 </x-element-signature>
96 </template>
97 <template instantiate="if element is ClassElement">
98 <x-doc-link class="element-name element-definition" ref="{{element}} "></x-doc-link>
99 </template>
100 <div class="documentation">
101 {{element.commentHtml}}
102 </div>
103 </summary>
104 <details class="extended-element-info">
105 <summary>View ?? comments.</summary>
106 TODO(jacobr): implement.
107 </details>
108 </details>
109 </template>
110 <script type="application/dart">
111 // TODO(jacobr): this is kinda a rediculous way to do this
112 import 'package:web_ui/web_ui.dart';
113 import 'ast.dart';
114 import 'model.dart';
115
116 class ElementSummary extends WebComponent {
117 Element element;
118 }
119 </script>
120 </element>
121
122 <element name="x-class-hierarchy-subtree" constructor="ClassHierarchySubtree" extends="div">
123 <template>
124 <template instantiate="if (index < clazz.superclasses.length)">
125 <div><x-doc-link ref={{clazz.superclasses[index]}}></x-doc-link></div>
126 <div style="padding-left: 15px">
127 <x-class-hierarchy-subtree clazz="{{clazz}}" index="{{index+1}}">
128 </x-class-hierarchy-subtree>
129 </div>
130 </template>
131 <template instantiate="if index == clazz.superclasses.length">
132 <div><strong>{{clazz.name}}</strong></div>
133 </template>
134 </template>
135 <script type="application/dart">
136 // TODO(jacobr): this is kinda a rediculous way to do this
137 import 'package:web_ui/web_ui.dart';
138 import 'ast.dart';
139 import 'model.dart';
140
141 class ClassHierarchySubtree extends WebComponent {
142 ClassElement clazz;
143 int index;
144 }
145 </script>
146 </element>
147
148 <element name="x-class-hierarchy" constructor="ClassHierarchy" extends="div">
149 <template>
150 <x-class-hierarchy-subtree clazz="{{clazz}}" index="{{0}}">
151 </x-class-hierarchy-subtree>
152 </template>
153 <script type="application/dart">
154 import 'package:web_ui/web_ui.dart';
155 import 'ast.dart';
156 import 'model.dart';
157
158 class ClassHierarchy extends WebComponent {
159 ClassElement clazz;
160 }
161 </script>
162 </element>
163 <!-- more below... -->
164 </body></html> 32 </body></html>
OLDNEW
« no previous file with comments | « client/web/ast.dart ('k') | client/web/element_summary.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698