Skip to content

Commit 8cc0d16

Browse files
astashovkeertip
authored andcommitted
Deemphasize and resort the inherited members [#641] (#1324)
@sethladd asked to reorder the list of methods and properties in a way that the inherited members go last, and also deemphasized in the output (the names will be nonbold and italic). This way it will be easier to grasp when skimming through the docs what are the new methods/fields of a class, but you still can see all of them and we don't introduce any new togglers/switchers, which would complicate the UI/UX. Testing: Generated Flutter docs, made sure the inherited members are nonbold/italic and go last. Fixes #641
1 parent 5e6cd06 commit 8cc0d16

File tree

302 files changed

+951
-928
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

302 files changed

+951
-928
lines changed

lib/resources/styles.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,3 +754,16 @@ li.inherited a {
754754
opacity: 0.65;
755755
font-style: italic;
756756
}
757+
758+
#instance-methods dt.inherited .name,
759+
#instance-properties dt.inherited .name,
760+
#operators dt.inherited .name {
761+
font-weight: 300;
762+
font-style: italic;
763+
}
764+
765+
#instance-methods dt.inherited .signature,
766+
#instance-properties dt.inherited .signature,
767+
#operators dt.inherited .signature {
768+
font-weight: 300;
769+
}

lib/src/model.dart

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,8 @@ class Class extends ModelElement implements EnclosedElement {
204204
List<Method> get allInstanceMethods {
205205
if (_allInstanceMethods != null) return _allInstanceMethods;
206206
_allInstanceMethods = []
207-
..addAll(instanceMethods)
208-
..addAll(inheritedMethods)
209-
..sort(byName);
207+
..addAll([]..addAll(instanceMethods)..sort(byName))
208+
..addAll([]..addAll(inheritedMethods)..sort(byName));
210209
return _allInstanceMethods;
211210
}
212211

@@ -218,9 +217,8 @@ class Class extends ModelElement implements EnclosedElement {
218217

219218
// TODO best way to make this a fixed length list?
220219
_allInstanceProperties = []
221-
..addAll(instanceProperties)
222-
..addAll(inheritedProperties)
223-
..sort(byName);
220+
..addAll([]..addAll(instanceProperties)..sort(byName))
221+
..addAll([]..addAll(inheritedProperties)..sort(byName));
224222

225223
return _allInstanceProperties;
226224
}
@@ -231,9 +229,8 @@ class Class extends ModelElement implements EnclosedElement {
231229
List<Operator> get allOperators {
232230
if (_allOperators != null) return _allOperators;
233231
_allOperators = []
234-
..addAll(operators)
235-
..addAll(inheritedOperators)
236-
..sort(byName);
232+
..addAll([]..addAll(operators)..sort(byName))
233+
..addAll([]..addAll(inheritedOperators)..sort(byName));
237234
return _allOperators;
238235
}
239236

testing/test_package_docs/ex/Animal-class.html

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -192,16 +192,6 @@ <h2>Constants</h2>
192192
<h2>Properties</h2>
193193

194194
<dl class="properties">
195-
<dt id="hashCode" class="property inherited">
196-
<span class="name"><a href="ex/Animal/hashCode.html">hashCode</a></span>
197-
<span class="signature">&#8594; int</span>
198-
</dt>
199-
<dd class="inherited">
200-
<p>Get a hash code for this object.</p>
201-
<div class="features">
202-
read-only, inherited
203-
</div>
204-
</dd>
205195
<dt id="index" class="property">
206196
<span class="name">index</span>
207197
<span class="signature">&#8594; int</span>
@@ -211,6 +201,16 @@ <h2>Properties</h2>
211201
<div class="features">
212202
read-only
213203
</div>
204+
</dd>
205+
<dt id="hashCode" class="property inherited">
206+
<span class="name"><a href="ex/Animal/hashCode.html">hashCode</a></span>
207+
<span class="signature">&#8594; int</span>
208+
</dt>
209+
<dd class="inherited">
210+
<p>Get a hash code for this object.</p>
211+
<div class="features">
212+
read-only, inherited
213+
</div>
214214
</dd>
215215
<dt id="runtimeType" class="property inherited">
216216
<span class="name"><a href="ex/Animal/runtimeType.html">runtimeType</a></span>
@@ -281,8 +281,8 @@ <h5>Animal</h5>
281281
<li class="section-title">
282282
<a href="ex/Animal-class.html#instance-properties">Properties</a>
283283
</li>
284-
<li class="inherited"><a href="ex/Animal/hashCode.html">hashCode</a></li>
285284
<li>index</li>
285+
<li class="inherited"><a href="ex/Animal/hashCode.html">hashCode</a></li>
286286
<li class="inherited"><a href="ex/Animal/runtimeType.html">runtimeType</a></li>
287287

288288
<li class="section-title inherited"><a href="ex/Animal-class.html#operators">Operators</a></li>

testing/test_package_docs/ex/Apple-class.html

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -227,44 +227,44 @@ <h2>Properties</h2>
227227
read-only
228228
</div>
229229
</dd>
230-
<dt id="hashCode" class="property inherited">
231-
<span class="name"><a href="ex/Apple/hashCode.html">hashCode</a></span>
230+
<dt id="m" class="property">
231+
<span class="name"><a href="ex/Apple/m.html">m</a></span>
232232
<span class="signature">&#8594; int</span>
233233
</dt>
234-
<dd class="inherited">
235-
<p>Get a hash code for this object.</p>
234+
<dd>
235+
<p>The read-write field <code>m</code>.</p>
236236
<div class="features">
237-
read-only, inherited
237+
read / write
238238
</div>
239239
</dd>
240-
<dt id="m" class="property">
241-
<span class="name"><a href="ex/Apple/m.html">m</a></span>
242-
<span class="signature">&#8594; int</span>
240+
<dt id="s" class="property">
241+
<span class="name"><a href="ex/Apple/s.html">s</a></span>
242+
<span class="signature">&#8594; String</span>
243243
</dt>
244244
<dd>
245-
<p>The read-write field <code>m</code>.</p>
245+
<p>The getter for <code>s</code></p>
246246
<div class="features">
247247
read / write
248248
</div>
249249
</dd>
250-
<dt id="runtimeType" class="property inherited">
251-
<span class="name"><a href="ex/Apple/runtimeType.html">runtimeType</a></span>
252-
<span class="signature">&#8594; Type</span>
250+
<dt id="hashCode" class="property inherited">
251+
<span class="name"><a href="ex/Apple/hashCode.html">hashCode</a></span>
252+
<span class="signature">&#8594; int</span>
253253
</dt>
254254
<dd class="inherited">
255-
<p>A representation of the runtime type of the object.</p>
255+
<p>Get a hash code for this object.</p>
256256
<div class="features">
257257
read-only, inherited
258258
</div>
259259
</dd>
260-
<dt id="s" class="property">
261-
<span class="name"><a href="ex/Apple/s.html">s</a></span>
262-
<span class="signature">&#8594; String</span>
260+
<dt id="runtimeType" class="property inherited">
261+
<span class="name"><a href="ex/Apple/runtimeType.html">runtimeType</a></span>
262+
<span class="signature">&#8594; Type</span>
263263
</dt>
264-
<dd>
265-
<p>The getter for <code>s</code></p>
264+
<dd class="inherited">
265+
<p>A representation of the runtime type of the object.</p>
266266
<div class="features">
267-
read / write
267+
read-only, inherited
268268
</div>
269269
</dd>
270270
</dl>
@@ -320,15 +320,6 @@ <h2>Methods</h2>
320320
<dd>
321321
<p></p>
322322
</dd>
323-
<dt id="noSuchMethod" class="callable inherited">
324-
<span class="name"><a href="ex/Apple/noSuchMethod.html">noSuchMethod</a></span><span class="signature">(<wbr><span class="parameter" id="noSuchMethod-param-invocation"><span class="type-annotation">Invocation</span> <span class="parameter-name">invocation</span></span>)
325-
<span class="returntype parameter">&#8594; dynamic</span>
326-
</span>
327-
</dt>
328-
<dd class="inherited">
329-
<p>Invoked when a non-existent method or property is accessed.</p>
330-
<div class="features">inherited</div>
331-
</dd>
332323
<dt id="paramFromExportLib" class="callable">
333324
<span class="name"><a href="ex/Apple/paramFromExportLib.html">paramFromExportLib</a></span><span class="signature">(<wbr><span class="parameter" id="paramFromExportLib-param-helper"><span class="type-annotation"><a href="ex/Helper-class.html">Helper</a></span> <span class="parameter-name">helper</span></span>)
334325
<span class="returntype parameter">&#8594; void</span>
@@ -345,6 +336,15 @@ <h2>Methods</h2>
345336
<dd>
346337
<p></p>
347338
</dd>
339+
<dt id="noSuchMethod" class="callable inherited">
340+
<span class="name"><a href="ex/Apple/noSuchMethod.html">noSuchMethod</a></span><span class="signature">(<wbr><span class="parameter" id="noSuchMethod-param-invocation"><span class="type-annotation">Invocation</span> <span class="parameter-name">invocation</span></span>)
341+
<span class="returntype parameter">&#8594; dynamic</span>
342+
</span>
343+
</dt>
344+
<dd class="inherited">
345+
<p>Invoked when a non-existent method or property is accessed.</p>
346+
<div class="features">inherited</div>
347+
</dd>
348348
<dt id="toString" class="callable inherited">
349349
<span class="name"><a href="ex/Apple/toString.html">toString</a></span><span class="signature">(<wbr>)
350350
<span class="returntype parameter">&#8594; String</span>
@@ -377,10 +377,10 @@ <h5>Apple</h5>
377377
<a href="ex/Apple-class.html#instance-properties">Properties</a>
378378
</li>
379379
<li><a href="ex/Apple/fieldWithTypedef.html">fieldWithTypedef</a></li>
380-
<li class="inherited"><a href="ex/Apple/hashCode.html">hashCode</a></li>
381380
<li><a href="ex/Apple/m.html">m</a></li>
382-
<li class="inherited"><a href="ex/Apple/runtimeType.html">runtimeType</a></li>
383381
<li><a href="ex/Apple/s.html">s</a></li>
382+
<li class="inherited"><a href="ex/Apple/hashCode.html">hashCode</a></li>
383+
<li class="inherited"><a href="ex/Apple/runtimeType.html">runtimeType</a></li>
384384

385385
<li class="section-title"><a href="ex/Apple-class.html#operators">Operators</a></li>
386386
<li><a href="ex/Apple/operator_multiply.html">operator *</a></li>
@@ -390,9 +390,9 @@ <h5>Apple</h5>
390390
<li><a href="ex/Apple/isGreaterThan.html">isGreaterThan</a></li>
391391
<li><a href="ex/Apple/m1.html">m1</a></li>
392392
<li><a href="ex/Apple/methodWithTypedefParam.html">methodWithTypedefParam</a></li>
393-
<li class="inherited"><a href="ex/Apple/noSuchMethod.html">noSuchMethod</a></li>
394393
<li><a href="ex/Apple/paramFromExportLib.html">paramFromExportLib</a></li>
395394
<li><a href="ex/Apple/printMsg.html">printMsg</a></li>
395+
<li class="inherited"><a href="ex/Apple/noSuchMethod.html">noSuchMethod</a></li>
396396
<li class="inherited"><a href="ex/Apple/toString.html">toString</a></li>
397397
</ol>
398398
</div><!--/.sidebar-offcanvas-->

testing/test_package_docs/ex/Apple/Apple.fromString.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ <h5><a href="ex/Apple-class.html">Apple</a></h5>
8989
<a href="ex/Apple-class.html#instance-properties">Properties</a>
9090
</li>
9191
<li><a href="ex/Apple/fieldWithTypedef.html">fieldWithTypedef</a></li>
92-
<li class="inherited"><a href="ex/Apple/hashCode.html">hashCode</a></li>
9392
<li><a href="ex/Apple/m.html">m</a></li>
94-
<li class="inherited"><a href="ex/Apple/runtimeType.html">runtimeType</a></li>
9593
<li><a href="ex/Apple/s.html">s</a></li>
94+
<li class="inherited"><a href="ex/Apple/hashCode.html">hashCode</a></li>
95+
<li class="inherited"><a href="ex/Apple/runtimeType.html">runtimeType</a></li>
9696

9797
<li class="section-title"><a href="ex/Apple-class.html#operators">Operators</a></li>
9898
<li><a href="ex/Apple/operator_multiply.html">operator *</a></li>
@@ -102,9 +102,9 @@ <h5><a href="ex/Apple-class.html">Apple</a></h5>
102102
<li><a href="ex/Apple/isGreaterThan.html">isGreaterThan</a></li>
103103
<li><a href="ex/Apple/m1.html">m1</a></li>
104104
<li><a href="ex/Apple/methodWithTypedefParam.html">methodWithTypedefParam</a></li>
105-
<li class="inherited"><a href="ex/Apple/noSuchMethod.html">noSuchMethod</a></li>
106105
<li><a href="ex/Apple/paramFromExportLib.html">paramFromExportLib</a></li>
107106
<li><a href="ex/Apple/printMsg.html">printMsg</a></li>
107+
<li class="inherited"><a href="ex/Apple/noSuchMethod.html">noSuchMethod</a></li>
108108
<li class="inherited"><a href="ex/Apple/toString.html">toString</a></li>
109109
</ol>
110110

testing/test_package_docs/ex/Apple/Apple.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@ <h5><a href="ex/Apple-class.html">Apple</a></h5>
8989
<a href="ex/Apple-class.html#instance-properties">Properties</a>
9090
</li>
9191
<li><a href="ex/Apple/fieldWithTypedef.html">fieldWithTypedef</a></li>
92-
<li class="inherited"><a href="ex/Apple/hashCode.html">hashCode</a></li>
9392
<li><a href="ex/Apple/m.html">m</a></li>
94-
<li class="inherited"><a href="ex/Apple/runtimeType.html">runtimeType</a></li>
9593
<li><a href="ex/Apple/s.html">s</a></li>
94+
<li class="inherited"><a href="ex/Apple/hashCode.html">hashCode</a></li>
95+
<li class="inherited"><a href="ex/Apple/runtimeType.html">runtimeType</a></li>
9696

9797
<li class="section-title"><a href="ex/Apple-class.html#operators">Operators</a></li>
9898
<li><a href="ex/Apple/operator_multiply.html">operator *</a></li>
@@ -102,9 +102,9 @@ <h5><a href="ex/Apple-class.html">Apple</a></h5>
102102
<li><a href="ex/Apple/isGreaterThan.html">isGreaterThan</a></li>
103103
<li><a href="ex/Apple/m1.html">m1</a></li>
104104
<li><a href="ex/Apple/methodWithTypedefParam.html">methodWithTypedefParam</a></li>
105-
<li class="inherited"><a href="ex/Apple/noSuchMethod.html">noSuchMethod</a></li>
106105
<li><a href="ex/Apple/paramFromExportLib.html">paramFromExportLib</a></li>
107106
<li><a href="ex/Apple/printMsg.html">printMsg</a></li>
107+
<li class="inherited"><a href="ex/Apple/noSuchMethod.html">noSuchMethod</a></li>
108108
<li class="inherited"><a href="ex/Apple/toString.html">toString</a></li>
109109
</ol>
110110

testing/test_package_docs/ex/Apple/fieldWithTypedef.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ <h5><a href="ex/Apple-class.html">Apple</a></h5>
8888
<a href="ex/Apple-class.html#instance-properties">Properties</a>
8989
</li>
9090
<li><a href="ex/Apple/fieldWithTypedef.html">fieldWithTypedef</a></li>
91-
<li class="inherited"><a href="ex/Apple/hashCode.html">hashCode</a></li>
9291
<li><a href="ex/Apple/m.html">m</a></li>
93-
<li class="inherited"><a href="ex/Apple/runtimeType.html">runtimeType</a></li>
9492
<li><a href="ex/Apple/s.html">s</a></li>
93+
<li class="inherited"><a href="ex/Apple/hashCode.html">hashCode</a></li>
94+
<li class="inherited"><a href="ex/Apple/runtimeType.html">runtimeType</a></li>
9595

9696
<li class="section-title"><a href="ex/Apple-class.html#operators">Operators</a></li>
9797
<li><a href="ex/Apple/operator_multiply.html">operator *</a></li>
@@ -101,9 +101,9 @@ <h5><a href="ex/Apple-class.html">Apple</a></h5>
101101
<li><a href="ex/Apple/isGreaterThan.html">isGreaterThan</a></li>
102102
<li><a href="ex/Apple/m1.html">m1</a></li>
103103
<li><a href="ex/Apple/methodWithTypedefParam.html">methodWithTypedefParam</a></li>
104-
<li class="inherited"><a href="ex/Apple/noSuchMethod.html">noSuchMethod</a></li>
105104
<li><a href="ex/Apple/paramFromExportLib.html">paramFromExportLib</a></li>
106105
<li><a href="ex/Apple/printMsg.html">printMsg</a></li>
106+
<li class="inherited"><a href="ex/Apple/noSuchMethod.html">noSuchMethod</a></li>
107107
<li class="inherited"><a href="ex/Apple/toString.html">toString</a></li>
108108
</ol>
109109

testing/test_package_docs/ex/Apple/hashCode.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ <h5><a href="ex/Apple-class.html">Apple</a></h5>
8888
<a href="ex/Apple-class.html#instance-properties">Properties</a>
8989
</li>
9090
<li><a href="ex/Apple/fieldWithTypedef.html">fieldWithTypedef</a></li>
91-
<li class="inherited"><a href="ex/Apple/hashCode.html">hashCode</a></li>
9291
<li><a href="ex/Apple/m.html">m</a></li>
93-
<li class="inherited"><a href="ex/Apple/runtimeType.html">runtimeType</a></li>
9492
<li><a href="ex/Apple/s.html">s</a></li>
93+
<li class="inherited"><a href="ex/Apple/hashCode.html">hashCode</a></li>
94+
<li class="inherited"><a href="ex/Apple/runtimeType.html">runtimeType</a></li>
9595

9696
<li class="section-title"><a href="ex/Apple-class.html#operators">Operators</a></li>
9797
<li><a href="ex/Apple/operator_multiply.html">operator *</a></li>
@@ -101,9 +101,9 @@ <h5><a href="ex/Apple-class.html">Apple</a></h5>
101101
<li><a href="ex/Apple/isGreaterThan.html">isGreaterThan</a></li>
102102
<li><a href="ex/Apple/m1.html">m1</a></li>
103103
<li><a href="ex/Apple/methodWithTypedefParam.html">methodWithTypedefParam</a></li>
104-
<li class="inherited"><a href="ex/Apple/noSuchMethod.html">noSuchMethod</a></li>
105104
<li><a href="ex/Apple/paramFromExportLib.html">paramFromExportLib</a></li>
106105
<li><a href="ex/Apple/printMsg.html">printMsg</a></li>
106+
<li class="inherited"><a href="ex/Apple/noSuchMethod.html">noSuchMethod</a></li>
107107
<li class="inherited"><a href="ex/Apple/toString.html">toString</a></li>
108108
</ol>
109109

testing/test_package_docs/ex/Apple/isGreaterThan.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ <h5><a href="ex/Apple-class.html">Apple</a></h5>
8888
<a href="ex/Apple-class.html#instance-properties">Properties</a>
8989
</li>
9090
<li><a href="ex/Apple/fieldWithTypedef.html">fieldWithTypedef</a></li>
91-
<li class="inherited"><a href="ex/Apple/hashCode.html">hashCode</a></li>
9291
<li><a href="ex/Apple/m.html">m</a></li>
93-
<li class="inherited"><a href="ex/Apple/runtimeType.html">runtimeType</a></li>
9492
<li><a href="ex/Apple/s.html">s</a></li>
93+
<li class="inherited"><a href="ex/Apple/hashCode.html">hashCode</a></li>
94+
<li class="inherited"><a href="ex/Apple/runtimeType.html">runtimeType</a></li>
9595

9696
<li class="section-title"><a href="ex/Apple-class.html#operators">Operators</a></li>
9797
<li><a href="ex/Apple/operator_multiply.html">operator *</a></li>
@@ -101,9 +101,9 @@ <h5><a href="ex/Apple-class.html">Apple</a></h5>
101101
<li><a href="ex/Apple/isGreaterThan.html">isGreaterThan</a></li>
102102
<li><a href="ex/Apple/m1.html">m1</a></li>
103103
<li><a href="ex/Apple/methodWithTypedefParam.html">methodWithTypedefParam</a></li>
104-
<li class="inherited"><a href="ex/Apple/noSuchMethod.html">noSuchMethod</a></li>
105104
<li><a href="ex/Apple/paramFromExportLib.html">paramFromExportLib</a></li>
106105
<li><a href="ex/Apple/printMsg.html">printMsg</a></li>
106+
<li class="inherited"><a href="ex/Apple/noSuchMethod.html">noSuchMethod</a></li>
107107
<li class="inherited"><a href="ex/Apple/toString.html">toString</a></li>
108108
</ol>
109109

testing/test_package_docs/ex/Apple/m.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ <h5><a href="ex/Apple-class.html">Apple</a></h5>
8888
<a href="ex/Apple-class.html#instance-properties">Properties</a>
8989
</li>
9090
<li><a href="ex/Apple/fieldWithTypedef.html">fieldWithTypedef</a></li>
91-
<li class="inherited"><a href="ex/Apple/hashCode.html">hashCode</a></li>
9291
<li><a href="ex/Apple/m.html">m</a></li>
93-
<li class="inherited"><a href="ex/Apple/runtimeType.html">runtimeType</a></li>
9492
<li><a href="ex/Apple/s.html">s</a></li>
93+
<li class="inherited"><a href="ex/Apple/hashCode.html">hashCode</a></li>
94+
<li class="inherited"><a href="ex/Apple/runtimeType.html">runtimeType</a></li>
9595

9696
<li class="section-title"><a href="ex/Apple-class.html#operators">Operators</a></li>
9797
<li><a href="ex/Apple/operator_multiply.html">operator *</a></li>
@@ -101,9 +101,9 @@ <h5><a href="ex/Apple-class.html">Apple</a></h5>
101101
<li><a href="ex/Apple/isGreaterThan.html">isGreaterThan</a></li>
102102
<li><a href="ex/Apple/m1.html">m1</a></li>
103103
<li><a href="ex/Apple/methodWithTypedefParam.html">methodWithTypedefParam</a></li>
104-
<li class="inherited"><a href="ex/Apple/noSuchMethod.html">noSuchMethod</a></li>
105104
<li><a href="ex/Apple/paramFromExportLib.html">paramFromExportLib</a></li>
106105
<li><a href="ex/Apple/printMsg.html">printMsg</a></li>
106+
<li class="inherited"><a href="ex/Apple/noSuchMethod.html">noSuchMethod</a></li>
107107
<li class="inherited"><a href="ex/Apple/toString.html">toString</a></li>
108108
</ol>
109109

0 commit comments

Comments
 (0)