Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/resources/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ ul.subnav {
overflow: auto;
white-space: nowrap;
padding-left: 0;
min-height: 24px;
min-height: 25px;
}

ul.subnav::-webkit-scrollbar {
Expand Down
26 changes: 14 additions & 12 deletions lib/src/html/template_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,21 @@ abstract class TemplateData<T extends Documentable> {
String get version => htmlOptions.toolVersion;
String get relCanonicalPrefix => htmlOptions.relCanonicalPrefix;

Iterable<Subnav> getSubNavItems() => const Iterable<Subnav>.empty();
Iterable<Subnav> getSubNavItems() => <Subnav>[];

String _layoutTitle(String name, String kind, bool isDeprecated) {
if (kind.isEmpty)
kind =
'&nbsp;'; // Ugly. fixes https://github.com/dart-lang/dartdoc/issues/695
if (kind.isEmpty) kind = '&nbsp;';
String str = '<span class="kind">$kind</span>';
if (!isDeprecated) return '${str} ${name}';
return '${str} <span class="deprecated">$name</span>';
}

Iterable<Subnav> _gatherSubnavForInvokable(ModelElement element) sync* {
Iterable<Subnav> _gatherSubnavForInvokable(ModelElement element) {
if (element is SourceCodeMixin &&
(element as SourceCodeMixin).hasSourceCode) {
yield new Subnav('Source', '${element.href}#source');
return [new Subnav('Source', '${element.href}#source')];
} else {
return <Subnav>[];
}
}
}
Expand All @@ -83,14 +83,14 @@ class PackageTemplateData extends TemplateData<Package> {
@override
Package get self => package;
@override
String get layoutTitle =>
_layoutTitle(package.name, package.isSdk ? '' : 'package', false);
String get layoutTitle => _layoutTitle(
package.name, (useCategories || package.isSdk) ? '' : 'package', false);
@override
String get metaDescription =>
'${package.name} API docs, for the Dart programming language.';
@override
Iterable<Subnav> getSubNavItems() sync* {
yield new Subnav('Libraries', '${package.href}#libraries');
Iterable<Subnav> getSubNavItems() {
return [new Subnav('Libraries', '${package.href}#libraries')];
}

/// `null` for packages because they are at the root – not needed
Expand Down Expand Up @@ -177,13 +177,13 @@ class ClassTemplateData extends TemplateData<Class> {
yield new Subnav('Static Properties', '${clazz.href}#static-properties');
if (clazz.hasStaticMethods)
yield new Subnav('Static Methods', '${clazz.href}#static-methods');
if (clazz.hasInstanceProperties)
if (clazz.hasProperties)
yield new Subnav('Properties', '${clazz.href}#instance-properties');
if (clazz.hasConstructors)
yield new Subnav('Constructors', '${clazz.href}#constructors');
if (clazz.hasOperators)
yield new Subnav('Operators', '${clazz.href}#operators');
if (clazz.hasInstanceMethods)
if (clazz.hasMethods)
yield new Subnav('Methods', '${clazz.href}#instance-methods');
}

Expand Down Expand Up @@ -383,6 +383,8 @@ class TypedefTemplateData extends TemplateData<Typedef> {
List get navLinks => [package, library];
@override
String get htmlBase => '..';
@override
Iterable<Subnav> getSubNavItems() => _gatherSubnavForInvokable(typeDef);
}

class TopLevelPropertyTemplateData extends TemplateData<TopLevelVariable> {
Expand Down
2 changes: 2 additions & 0 deletions testing/test_package_docs/ex/CatString-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ <h1 class="title">
</h1>
</div>
<ul class="subnav">
<li><a href="ex/CatString-class.html#instance-properties">Properties</a></li>
<li><a href="ex/CatString-class.html#constructors">Constructors</a></li>
<li><a href="ex/CatString-class.html#operators">Operators</a></li>
<li><a href="ex/CatString-class.html#instance-methods">Methods</a></li>
</ul>
</div> <!-- /col -->
</div> <!-- /row -->
Expand Down
1 change: 1 addition & 0 deletions testing/test_package_docs/ex/Cool-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ <h1 class="title">
</h1>
</div>
<ul class="subnav">
<li><a href="ex/Cool-class.html#instance-properties">Properties</a></li>
<li><a href="ex/Cool-class.html#constructors">Constructors</a></li>
<li><a href="ex/Cool-class.html#operators">Operators</a></li>
<li><a href="ex/Cool-class.html#instance-methods">Methods</a></li>
Expand Down
2 changes: 2 additions & 0 deletions testing/test_package_docs/ex/E-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ <h1 class="title">
</h1>
</div>
<ul class="subnav">
<li><a href="ex/E-class.html#instance-properties">Properties</a></li>
<li><a href="ex/E-class.html#constructors">Constructors</a></li>
<li><a href="ex/E-class.html#operators">Operators</a></li>
<li><a href="ex/E-class.html#instance-methods">Methods</a></li>
</ul>
</div> <!-- /col -->
</div> <!-- /row -->
Expand Down
1 change: 1 addition & 0 deletions testing/test_package_docs/ex/F-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ <h1 class="title">
</h1>
</div>
<ul class="subnav">
<li><a href="ex/F-class.html#instance-properties">Properties</a></li>
<li><a href="ex/F-class.html#constructors">Constructors</a></li>
<li><a href="ex/F-class.html#operators">Operators</a></li>
<li><a href="ex/F-class.html#instance-methods">Methods</a></li>
Expand Down
1 change: 1 addition & 0 deletions testing/test_package_docs/ex/ForAnnotation-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ <h1 class="title">
<li><a href="ex/ForAnnotation-class.html#instance-properties">Properties</a></li>
<li><a href="ex/ForAnnotation-class.html#constructors">Constructors</a></li>
<li><a href="ex/ForAnnotation-class.html#operators">Operators</a></li>
<li><a href="ex/ForAnnotation-class.html#instance-methods">Methods</a></li>
</ul>
</div> <!-- /col -->
</div> <!-- /row -->
Expand Down
2 changes: 2 additions & 0 deletions testing/test_package_docs/ex/HasAnnotation-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ <h1 class="title">
</h1>
</div>
<ul class="subnav">
<li><a href="ex/HasAnnotation-class.html#instance-properties">Properties</a></li>
<li><a href="ex/HasAnnotation-class.html#constructors">Constructors</a></li>
<li><a href="ex/HasAnnotation-class.html#operators">Operators</a></li>
<li><a href="ex/HasAnnotation-class.html#instance-methods">Methods</a></li>
</ul>
</div> <!-- /col -->
</div> <!-- /row -->
Expand Down
1 change: 1 addition & 0 deletions testing/test_package_docs/ex/Helper-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ <h1 class="title">
</h1>
</div>
<ul class="subnav">
<li><a href="ex/Helper-class.html#instance-properties">Properties</a></li>
<li><a href="ex/Helper-class.html#constructors">Constructors</a></li>
<li><a href="ex/Helper-class.html#operators">Operators</a></li>
<li><a href="ex/Helper-class.html#instance-methods">Methods</a></li>
Expand Down
1 change: 1 addition & 0 deletions testing/test_package_docs/ex/Klass-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ <h1 class="title">
</h1>
</div>
<ul class="subnav">
<li><a href="ex/Klass-class.html#instance-properties">Properties</a></li>
<li><a href="ex/Klass-class.html#constructors">Constructors</a></li>
<li><a href="ex/Klass-class.html#operators">Operators</a></li>
<li><a href="ex/Klass-class.html#instance-methods">Methods</a></li>
Expand Down
2 changes: 2 additions & 0 deletions testing/test_package_docs/ex/MyError-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ <h1 class="title">
</h1>
</div>
<ul class="subnav">
<li><a href="ex/MyError-class.html#instance-properties">Properties</a></li>
<li><a href="ex/MyError-class.html#constructors">Constructors</a></li>
<li><a href="ex/MyError-class.html#operators">Operators</a></li>
<li><a href="ex/MyError-class.html#instance-methods">Methods</a></li>
</ul>
</div> <!-- /col -->
</div> <!-- /row -->
Expand Down
1 change: 1 addition & 0 deletions testing/test_package_docs/ex/MyErrorImplements-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ <h1 class="title">
<li><a href="ex/MyErrorImplements-class.html#instance-properties">Properties</a></li>
<li><a href="ex/MyErrorImplements-class.html#constructors">Constructors</a></li>
<li><a href="ex/MyErrorImplements-class.html#operators">Operators</a></li>
<li><a href="ex/MyErrorImplements-class.html#instance-methods">Methods</a></li>
</ul>
</div> <!-- /col -->
</div> <!-- /row -->
Expand Down
2 changes: 2 additions & 0 deletions testing/test_package_docs/ex/MyException-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ <h1 class="title">
</h1>
</div>
<ul class="subnav">
<li><a href="ex/MyException-class.html#instance-properties">Properties</a></li>
<li><a href="ex/MyException-class.html#constructors">Constructors</a></li>
<li><a href="ex/MyException-class.html#operators">Operators</a></li>
<li><a href="ex/MyException-class.html#instance-methods">Methods</a></li>
</ul>
</div> <!-- /col -->
</div> <!-- /row -->
Expand Down
2 changes: 2 additions & 0 deletions testing/test_package_docs/ex/MyExceptionImplements-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ <h1 class="title">
</h1>
</div>
<ul class="subnav">
<li><a href="ex/MyExceptionImplements-class.html#instance-properties">Properties</a></li>
<li><a href="ex/MyExceptionImplements-class.html#constructors">Constructors</a></li>
<li><a href="ex/MyExceptionImplements-class.html#operators">Operators</a></li>
<li><a href="ex/MyExceptionImplements-class.html#instance-methods">Methods</a></li>
</ul>
</div> <!-- /col -->
</div> <!-- /row -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ <h1 class="title">
</h1>
</div>
<ul class="subnav">
<li><a href="ex/PublicClassExtendsPrivateClass-class.html#instance-properties">Properties</a></li>
<li><a href="ex/PublicClassExtendsPrivateClass-class.html#constructors">Constructors</a></li>
<li><a href="ex/PublicClassExtendsPrivateClass-class.html#operators">Operators</a></li>
<li><a href="ex/PublicClassExtendsPrivateClass-class.html#instance-methods">Methods</a></li>
</ul>
</div> <!-- /col -->
</div> <!-- /row -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ <h1 class="title">
</h1>
</div>
<ul class="subnav">
<li><a href="ex/PublicClassImplementsPrivateInterface-class.html#instance-properties">Properties</a></li>
<li><a href="ex/PublicClassImplementsPrivateInterface-class.html#constructors">Constructors</a></li>
<li><a href="ex/PublicClassImplementsPrivateInterface-class.html#operators">Operators</a></li>
<li><a href="ex/PublicClassImplementsPrivateInterface-class.html#instance-methods">Methods</a></li>
Expand Down
2 changes: 2 additions & 0 deletions testing/test_package_docs/ex/ShapeType-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ <h1 class="title">
</div>
<ul class="subnav">
<li><a href="ex/ShapeType-class.html#constants">Constants</a></li>
<li><a href="ex/ShapeType-class.html#instance-properties">Properties</a></li>
<li><a href="ex/ShapeType-class.html#operators">Operators</a></li>
<li><a href="ex/ShapeType-class.html#instance-methods">Methods</a></li>
</ul>
</div> <!-- /col -->
</div> <!-- /row -->
Expand Down
2 changes: 2 additions & 0 deletions testing/test_package_docs/ex/SpecializedDuration-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ <h1 class="title">
</h1>
</div>
<ul class="subnav">
<li><a href="ex/SpecializedDuration-class.html#instance-properties">Properties</a></li>
<li><a href="ex/SpecializedDuration-class.html#constructors">Constructors</a></li>
<li><a href="ex/SpecializedDuration-class.html#operators">Operators</a></li>
<li><a href="ex/SpecializedDuration-class.html#instance-methods">Methods</a></li>
</ul>
</div> <!-- /col -->
</div> <!-- /row -->
Expand Down
1 change: 1 addition & 0 deletions testing/test_package_docs/fake/Annotation-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ <h1 class="title">
<li><a href="fake/Annotation-class.html#instance-properties">Properties</a></li>
<li><a href="fake/Annotation-class.html#constructors">Constructors</a></li>
<li><a href="fake/Annotation-class.html#operators">Operators</a></li>
<li><a href="fake/Annotation-class.html#instance-methods">Methods</a></li>
</ul>
</div> <!-- /col -->
</div> <!-- /row -->
Expand Down
2 changes: 2 additions & 0 deletions testing/test_package_docs/fake/AnotherInterface-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ <h1 class="title">
</h1>
</div>
<ul class="subnav">
<li><a href="fake/AnotherInterface-class.html#instance-properties">Properties</a></li>
<li><a href="fake/AnotherInterface-class.html#constructors">Constructors</a></li>
<li><a href="fake/AnotherInterface-class.html#operators">Operators</a></li>
<li><a href="fake/AnotherInterface-class.html#instance-methods">Methods</a></li>
</ul>
</div> <!-- /col -->
</div> <!-- /row -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ <h1 class="title">
</h1>
</div>
<ul class="subnav">
<li><a href="fake/BaseForDocComments-class.html#instance-properties">Properties</a></li>
<li><a href="fake/BaseForDocComments-class.html#constructors">Constructors</a></li>
<li><a href="fake/BaseForDocComments-class.html#operators">Operators</a></li>
<li><a href="fake/BaseForDocComments-class.html#instance-methods">Methods</a></li>
Expand Down
1 change: 1 addition & 0 deletions testing/test_package_docs/fake/ConstantClass-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ <h1 class="title">
<li><a href="fake/ConstantClass-class.html#instance-properties">Properties</a></li>
<li><a href="fake/ConstantClass-class.html#constructors">Constructors</a></li>
<li><a href="fake/ConstantClass-class.html#operators">Operators</a></li>
<li><a href="fake/ConstantClass-class.html#instance-methods">Methods</a></li>
</ul>
</div> <!-- /col -->
</div> <!-- /row -->
Expand Down
1 change: 1 addition & 0 deletions testing/test_package_docs/fake/Cool-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ <h1 class="title">
</h1>
</div>
<ul class="subnav">
<li><a href="fake/Cool-class.html#instance-properties">Properties</a></li>
<li><a href="fake/Cool-class.html#constructors">Constructors</a></li>
<li><a href="fake/Cool-class.html#operators">Operators</a></li>
<li><a href="fake/Cool-class.html#instance-methods">Methods</a></li>
Expand Down
2 changes: 2 additions & 0 deletions testing/test_package_docs/fake/Doh-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ <h1 class="title">
</h1>
</div>
<ul class="subnav">
<li><a href="fake/Doh-class.html#instance-properties">Properties</a></li>
<li><a href="fake/Doh-class.html#constructors">Constructors</a></li>
<li><a href="fake/Doh-class.html#operators">Operators</a></li>
<li><a href="fake/Doh-class.html#instance-methods">Methods</a></li>
</ul>
</div> <!-- /col -->
</div> <!-- /row -->
Expand Down
2 changes: 2 additions & 0 deletions testing/test_package_docs/fake/ExtraSpecialList-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ <h1 class="title">
</h1>
</div>
<ul class="subnav">
<li><a href="fake/ExtraSpecialList-class.html#instance-properties">Properties</a></li>
<li><a href="fake/ExtraSpecialList-class.html#constructors">Constructors</a></li>
<li><a href="fake/ExtraSpecialList-class.html#operators">Operators</a></li>
<li><a href="fake/ExtraSpecialList-class.html#instance-methods">Methods</a></li>
</ul>
</div> <!-- /col -->
</div> <!-- /row -->
Expand Down
1 change: 1 addition & 0 deletions testing/test_package_docs/fake/Foo2-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ <h1 class="title">
<li><a href="fake/Foo2-class.html#instance-properties">Properties</a></li>
<li><a href="fake/Foo2-class.html#constructors">Constructors</a></li>
<li><a href="fake/Foo2-class.html#operators">Operators</a></li>
<li><a href="fake/Foo2-class.html#instance-methods">Methods</a></li>
</ul>
</div> <!-- /col -->
</div> <!-- /row -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ <h1 class="title">
</h1>
</div>
<ul class="subnav">
<li><a href="fake/HasGenericWithExtends-class.html#instance-properties">Properties</a></li>
<li><a href="fake/HasGenericWithExtends-class.html#constructors">Constructors</a></li>
<li><a href="fake/HasGenericWithExtends-class.html#operators">Operators</a></li>
<li><a href="fake/HasGenericWithExtends-class.html#instance-methods">Methods</a></li>
</ul>
</div> <!-- /col -->
</div> <!-- /row -->
Expand Down
1 change: 1 addition & 0 deletions testing/test_package_docs/fake/HasGenerics-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ <h1 class="title">
</h1>
</div>
<ul class="subnav">
<li><a href="fake/HasGenerics-class.html#instance-properties">Properties</a></li>
<li><a href="fake/HasGenerics-class.html#constructors">Constructors</a></li>
<li><a href="fake/HasGenerics-class.html#operators">Operators</a></li>
<li><a href="fake/HasGenerics-class.html#instance-methods">Methods</a></li>
Expand Down
2 changes: 2 additions & 0 deletions testing/test_package_docs/fake/Interface-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ <h1 class="title">
</h1>
</div>
<ul class="subnav">
<li><a href="fake/Interface-class.html#instance-properties">Properties</a></li>
<li><a href="fake/Interface-class.html#constructors">Constructors</a></li>
<li><a href="fake/Interface-class.html#operators">Operators</a></li>
<li><a href="fake/Interface-class.html#instance-methods">Methods</a></li>
</ul>
</div> <!-- /col -->
</div> <!-- /row -->
Expand Down
2 changes: 2 additions & 0 deletions testing/test_package_docs/fake/MixMeIn-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ <h1 class="title">
</h1>
</div>
<ul class="subnav">
<li><a href="fake/MixMeIn-class.html#instance-properties">Properties</a></li>
<li><a href="fake/MixMeIn-class.html#constructors">Constructors</a></li>
<li><a href="fake/MixMeIn-class.html#operators">Operators</a></li>
<li><a href="fake/MixMeIn-class.html#instance-methods">Methods</a></li>
</ul>
</div> <!-- /col -->
</div> <!-- /row -->
Expand Down
1 change: 1 addition & 0 deletions testing/test_package_docs/fake/Oops-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ <h1 class="title">
<li><a href="fake/Oops-class.html#instance-properties">Properties</a></li>
<li><a href="fake/Oops-class.html#constructors">Constructors</a></li>
<li><a href="fake/Oops-class.html#operators">Operators</a></li>
<li><a href="fake/Oops-class.html#instance-methods">Methods</a></li>
</ul>
</div> <!-- /col -->
</div> <!-- /row -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,10 @@ <h1 class="title">
</h1>
</div>
<ul class="subnav">
<li><a href="fake/OperatorReferenceClass-class.html#instance-properties">Properties</a></li>
<li><a href="fake/OperatorReferenceClass-class.html#constructors">Constructors</a></li>
<li><a href="fake/OperatorReferenceClass-class.html#operators">Operators</a></li>
<li><a href="fake/OperatorReferenceClass-class.html#instance-methods">Methods</a></li>
</ul>
</div> <!-- /col -->
</div> <!-- /row -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ <h1 class="title">
</h1>
</div>
<ul class="subnav">
<li><a href="fake/OtherGenericsThing-class.html#instance-properties">Properties</a></li>
<li><a href="fake/OtherGenericsThing-class.html#constructors">Constructors</a></li>
<li><a href="fake/OtherGenericsThing-class.html#operators">Operators</a></li>
<li><a href="fake/OtherGenericsThing-class.html#instance-methods">Methods</a></li>
Expand Down
1 change: 1 addition & 0 deletions testing/test_package_docs/fake/SpecialList-class.html
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ <h1 class="title">
<li><a href="fake/SpecialList-class.html#instance-properties">Properties</a></li>
<li><a href="fake/SpecialList-class.html#constructors">Constructors</a></li>
<li><a href="fake/SpecialList-class.html#operators">Operators</a></li>
<li><a href="fake/SpecialList-class.html#instance-methods">Methods</a></li>
</ul>
</div> <!-- /col -->
</div> <!-- /row -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ <h1 class="title">
</h1>
</div>
<ul class="subnav">
<li><a href="fake/SubForDocComments-class.html#instance-properties">Properties</a></li>
<li><a href="fake/SubForDocComments-class.html#constructors">Constructors</a></li>
<li><a href="fake/SubForDocComments-class.html#operators">Operators</a></li>
<li><a href="fake/SubForDocComments-class.html#instance-methods">Methods</a></li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ <h1 class="title">
<li><a href="fake/WithGetterAndSetter-class.html#instance-properties">Properties</a></li>
<li><a href="fake/WithGetterAndSetter-class.html#constructors">Constructors</a></li>
<li><a href="fake/WithGetterAndSetter-class.html#operators">Operators</a></li>
<li><a href="fake/WithGetterAndSetter-class.html#instance-methods">Methods</a></li>
</ul>
</div> <!-- /col -->
</div> <!-- /row -->
Expand Down
Loading