Skip to content

Commit f05aba9

Browse files
committed
put peers on left side and simplify styles
breadcrumbs don't link the last element display a notice when something doesn't have docs
1 parent 0d0dd4e commit f05aba9

14 files changed

+567
-66
lines changed

lib/resources/styles.css

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ header.container-fluid {
5151
padding: 0;
5252
}
5353

54+
.body {
55+
margin-top: 16px;
56+
}
57+
58+
section {
59+
margin-bottom: 36px;
60+
}
61+
5462
dl {
5563
margin: 0;
5664
}
@@ -74,6 +82,10 @@ h2 {
7482
font-size: 32px;
7583
}
7684

85+
h5 {
86+
font-size: 16px;
87+
}
88+
7789
.subtitle {
7890
font-size: 17px;
7991
min-height: 1.4em;
@@ -95,6 +107,10 @@ li {
95107
color: #727272;
96108
}
97109

110+
p.no-docs {
111+
font-style: italic;
112+
}
113+
98114
a {
99115
color: #455A64;
100116
}
@@ -204,10 +220,6 @@ section.summary dt {
204220
text-indent: -24px;
205221
}
206222

207-
section.desc {
208-
padding-top: 16px;
209-
}
210-
211223
dl.dl-horizontal dt {
212224
font-style: normal;
213225
text-align: left;
@@ -341,6 +353,10 @@ footer .container-fluid {
341353
font-size: 17px;
342354
}
343355

356+
.breadcrumbs li.self-crumb {
357+
color: #CFD8DC;
358+
}
359+
344360
.annotation-list {
345361
list-style: none;
346362
padding: 0;
@@ -377,10 +393,6 @@ footer .container-fluid {
377393
content: ".";
378394
}
379395

380-
section {
381-
padding-top: 32px;
382-
}
383-
384396
.container > section:first-child {
385397
border: 0;
386398
}
@@ -455,10 +467,13 @@ span.top-level-variable-type {
455467

456468
/* sidebar styles */
457469

470+
.sidebar-offcanvas h5 {
471+
margin-bottom: 16px;
472+
}
473+
458474
ol#sidebar {
459475
list-style: none;
460476
padding: 0;
461-
margin-top: 16px;
462477
font-size: 14px;
463478
overflow: hidden;
464479
}
@@ -475,7 +490,6 @@ ol#sidebar li.section-title {
475490
font-size: 12px;
476491
text-transform: uppercase;
477492
font-weight: bold;
478-
padding-top: 16px;
479493
}
480494

481495
ol#sidebar li:first-child {

lib/src/html_generator.dart

Lines changed: 36 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,10 @@ class HtmlGeneratorInstance {
225225
_layoutTitle(package.name, package.isSdk ? '' : 'package', false),
226226
'metaDescription':
227227
'${package.name} API docs, for the Dart programming language.',
228-
'navLinks': [package],
228+
'navLinks': [], // we're at the root
229229
'subnavItems': _gatherSubnavForPackage(package),
230-
'htmlBase': '.'
230+
'htmlBase': '.',
231+
'self': package
231232
};
232233

233234
if (package.hasDocumentation) {
@@ -257,9 +258,10 @@ class HtmlGeneratorInstance {
257258
'htmlBase': '..',
258259
'metaDescription':
259260
'${lib.name} library API docs, for the Dart programming language.',
260-
'navLinks': [package, lib],
261+
'navLinks': [package],
261262
'subnavItems': _gatherSubnavForLibrary(lib),
262-
'layoutTitle': _layoutTitle(lib.name, 'library', lib.isDeprecated)
263+
'layoutTitle': _layoutTitle(lib.name, 'library', lib.isDeprecated),
264+
'self': lib
263265
};
264266

265267
_build(path.join(lib.dirName, '${lib.fileName}'),
@@ -297,9 +299,10 @@ class HtmlGeneratorInstance {
297299
'API docs for the ${clazz.name} ${clazz.kind} from the ${lib.name} library, for the Dart programming language.',
298300
'layoutTitle':
299301
_layoutTitle(clazz.nameWithGenerics, clazz.kind, clazz.isDeprecated),
300-
'navLinks': [package, lib, clazz],
302+
'navLinks': [package, lib],
301303
'subnavItems': _gatherSubnavForClass(clazz),
302-
'htmlBase': '..'
304+
'htmlBase': '..',
305+
'self': clazz
303306
};
304307

305308
_build(path.joinAll(clazz.href.split('/')), _templates.classTemplate, data);
@@ -317,8 +320,9 @@ class HtmlGeneratorInstance {
317320
'constructor': constructor,
318321
'layoutTitle': _layoutTitle(
319322
constructor.name, 'constructor', constructor.isDeprecated),
320-
'navLinks': [package, lib, clazz, constructor],
321-
'htmlBase': '../..'
323+
'navLinks': [package, lib, clazz],
324+
'htmlBase': '../..',
325+
'self': constructor
322326
};
323327

324328
_build(path.joinAll(constructor.href.split('/')),
@@ -334,8 +338,9 @@ class HtmlGeneratorInstance {
334338
'library': lib,
335339
'class': eNum,
336340
'layoutTitle': _layoutTitle(eNum.name, 'enum', eNum.isDeprecated),
337-
'navLinks': [package, lib, eNum],
338-
'htmlBase': '..'
341+
'navLinks': [package, lib],
342+
'htmlBase': '..',
343+
'self': eNum
339344
};
340345

341346
_build(path.joinAll(eNum.href.split('/')), _templates.classTemplate, data);
@@ -354,8 +359,9 @@ class HtmlGeneratorInstance {
354359
_layoutTitle(function.name, 'function', function.isDeprecated),
355360
'metaDescription':
356361
'API docs for the ${function.name} function from the ${lib.name} library, for the Dart programming language.',
357-
'navLinks': [package, lib, function],
358-
'htmlBase': '..'
362+
'navLinks': [package, lib],
363+
'htmlBase': '..',
364+
'self': function
359365
};
360366

361367
_build(path.joinAll(function.href.split('/')), _templates.functionTemplate,
@@ -377,8 +383,9 @@ class HtmlGeneratorInstance {
377383
'layoutTitle': _layoutTitle(method.name, 'method', method.isDeprecated),
378384
'metaDescription':
379385
'API docs for the ${method.name} method from the ${clazz.name} class, for the Dart programming language.',
380-
'navLinks': [package, lib, clazz, method],
381-
'htmlBase': '../..'
386+
'navLinks': [package, lib, clazz],
387+
'htmlBase': '../..',
388+
'self': method
382389
};
383390

384391
_build(
@@ -401,8 +408,9 @@ class HtmlGeneratorInstance {
401408
_layoutTitle(property.name, 'constant', property.isDeprecated),
402409
'metaDescription':
403410
'API docs for the ${property.name} constant from the ${clazz.name} class, for the Dart programming language.',
404-
'navLinks': [package, lib, clazz, property],
405-
'htmlBase': '../..'
411+
'navLinks': [package, lib, clazz],
412+
'htmlBase': '../..',
413+
'self': property
406414
};
407415

408416
_build(path.joinAll(property.href.split('/')), _templates.constantTemplate,
@@ -425,8 +433,9 @@ class HtmlGeneratorInstance {
425433
_layoutTitle(property.name, 'property', property.isDeprecated),
426434
'metaDescription':
427435
'API docs for the ${property.name} property from the ${clazz.name} class, for the Dart programming language.',
428-
'navLinks': [package, lib, clazz, property],
429-
'htmlBase': '../..'
436+
'navLinks': [package, lib, clazz],
437+
'htmlBase': '../..',
438+
'self': property
430439
};
431440

432441
_build(path.joinAll(property.href.split('/')), _templates.propertyTemplate,
@@ -447,8 +456,9 @@ class HtmlGeneratorInstance {
447456
_layoutTitle(property.name, 'property', property.isDeprecated),
448457
'metaDescription':
449458
'API docs for the ${property.name} property from the ${lib.name} library, for the Dart programming language.',
450-
'navLinks': [package, lib, property],
451-
'htmlBase': '..'
459+
'navLinks': [package, lib],
460+
'htmlBase': '..',
461+
'self': property
452462
};
453463

454464
_build(path.joinAll(property.href.split('/')),
@@ -469,8 +479,9 @@ class HtmlGeneratorInstance {
469479
_layoutTitle(property.name, 'constant', property.isDeprecated),
470480
'metaDescription':
471481
'API docs for the ${property.name} property from the ${lib.name} library, for the Dart programming language.',
472-
'navLinks': [package, lib, property],
473-
'htmlBase': '..'
482+
'navLinks': [package, lib],
483+
'htmlBase': '..',
484+
'self': property
474485
};
475486

476487
_build(path.joinAll(property.href.split('/')),
@@ -490,8 +501,9 @@ class HtmlGeneratorInstance {
490501
_layoutTitle(typeDef.name, 'typedef', typeDef.isDeprecated),
491502
'metaDescription':
492503
'API docs for the ${typeDef.name} property from the ${lib.name} library, for the Dart programming language.',
493-
'navLinks': [package, lib, typeDef],
494-
'htmlBase': '..'
504+
'navLinks': [package, lib],
505+
'htmlBase': '..',
506+
'self': typeDef
495507
};
496508

497509
_build(path.joinAll(typeDef.href.split('/')), _templates.typeDefTemplate,

lib/templates/_documentation.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
{{#hasDocumentation}}
1+
22
<section class="desc markdown">
33

4+
{{^hasDocumentation}}
5+
<p class="no-docs">(Not documented.)</p>
6+
{{/hasDocumentation}}
7+
48
{{{ documentationAsHtml }}}
59

610
</section>
7-
{{/hasDocumentation}}

lib/templates/_head.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
{{#navLinks}}
3131
<li><a href="{{href}}">{{name}}</a></li>
3232
{{/navLinks}}
33+
<li class="self-crumb">{{self.name}}</li>
3334
</ol>
3435
</div>
3536
</nav>
@@ -50,4 +51,4 @@ <h1 class="title">
5051
</div>
5152
</header>
5253

53-
<div class="container">
54+
<div class="container body">

lib/templates/class.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
</ol>
6565
</div><!--/.sidebar-offcanvas-->
6666

67-
<div class="col-xs-12 col-sm-9 main-content">
67+
<div class="col-xs-12 col-sm-9">
6868

6969
{{#class}}
7070
{{>documentation}}

lib/templates/constructor.html

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,75 @@
11
{{>head}}
22

3+
<div class="row row-offcanvas row-offcanvas-left">
4+
5+
<div class="col-xs-6 col-sm-3 sidebar-offcanvas">
6+
7+
<h5>{{{class.linkedName}}}</h5>
8+
9+
<ol id="sidebar">
10+
{{#class.hasConstants}}
11+
<li class="section-title"><a href="#constants">Constants</a></li>
12+
{{#class.constants}}
13+
<li><a href="{{href}}">{{name}}</a></li>
14+
{{/class.constants}}
15+
{{/class.hasConstants}}
16+
17+
{{#class.hasStaticProperties}}
18+
<li class="section-title"><a href="#static-properties">Static properties</a></li>
19+
{{#class.staticProperties}}
20+
<li><a href="{{href}}">{{name}}</a></li>
21+
{{/class.staticProperties}}
22+
{{/class.hasStaticProperties}}
23+
24+
{{#class.hasStaticMethods}}
25+
<li class="section-title"><a href="#static-methods">Static methods</a></li>
26+
{{#class.staticMethods}}
27+
<li><a href="{{href}}">{{name}}</a></li>
28+
{{/class.staticMethods}}
29+
{{/class.hasStaticMethods}}
30+
31+
{{#class.hasInstanceProperties}}
32+
<li class="section-title"><a href="#instance-properties">Properties</a></li>
33+
{{#class.instanceProperties}}
34+
<li><a href="{{href}}">{{name}}</a></li>
35+
{{/class.instanceProperties}}
36+
{{#class.inheritedProperties}}
37+
<li><a href="{{href}}">{{name}}</a></li>
38+
{{/class.inheritedProperties}}
39+
{{/class.hasInstanceProperties}}
40+
41+
{{#class.hasConstructors}}
42+
<li class="section-title"><a href="#constructors">Constructors</a></li>
43+
{{#class.constructors}}
44+
<li><a href="{{href}}">{{shortName}}</a></li>
45+
{{/class.constructors}}
46+
{{/class.hasConstructors}}
47+
48+
{{#class.hasOperators}}
49+
<li class="section-title"><a href="#operators">Operators</a></li>
50+
{{#class.operators}}
51+
<li><a href="{{href}}">{{name}}</a></li>
52+
{{/class.operators}}
53+
{{#class.inheritedOperators}}
54+
<li><a href="{{href}}">{{name}}</a></li>
55+
{{/class.inheritedOperators}}
56+
{{/class.hasOperators}}
57+
58+
{{#class.hasMethods}}
59+
<li class="section-title"><a href="#methods">Methods</a></li>
60+
{{#class.instanceMethods}}
61+
<li><a href="{{href}}">{{name}}</a></li>
62+
{{/class.instanceMethods}}
63+
{{#class.inheritedMethods}}
64+
<li><a href="{{href}}">{{name}}</a></li>
65+
{{/class.inheritedMethods}}
66+
{{/class.hasMethods}}
67+
</ol>
68+
69+
</div><!--/.sidebar-offcanvas-->
70+
71+
<div class="col-xs-12 col-sm-9">
72+
373
<section class="multi-line-signature">
474
{{#constructor}}
575
{{#isConst}}const{{/isConst}}
@@ -16,4 +86,8 @@
1686
{{>documentation}}
1787
{{/constructor}}
1888

89+
</div> <!-- /.col-xs-12.col-sm-9 -->
90+
91+
</div> <!-- /.row-offcanvas -->
92+
1993
{{>footer}}

0 commit comments

Comments
 (0)