diff --git a/lib/resources/styles.css b/lib/resources/styles.css index ab649eb8d1..8bc2416741 100644 --- a/lib/resources/styles.css +++ b/lib/resources/styles.css @@ -255,7 +255,6 @@ dd.callable, dd.constant, dd.property { } dd p { - white-space: nowrap; overflow-x: hidden; text-overflow: ellipsis; margin-bottom: 0; diff --git a/lib/src/html/templates.dart b/lib/src/html/templates.dart index bd7ecaa715..ca82c08685 100644 --- a/lib/src/html/templates.dart +++ b/lib/src/html/templates.dart @@ -10,8 +10,6 @@ import 'resource_loader.dart' as loader; typedef String TemplateRenderer(context, {bool assumeNullNonExistingProperty, bool errorOnMissingProperty}); -// TODO: if we can ever enumerate the contents of a package, we -// won't need this. const _partials = const [ 'callable', 'callable_multiline', @@ -26,7 +24,6 @@ const _partials = const [ 'sidebar_for_class', 'source_code', 'sidebar_for_library', - 'has_more_docs', 'accessor_getter', 'accessor_setter' ]; diff --git a/lib/src/markdown_processor.dart b/lib/src/markdown_processor.dart index 09cc53a289..833a5400a0 100644 --- a/lib/src/markdown_processor.dart +++ b/lib/src/markdown_processor.dart @@ -163,7 +163,6 @@ class Documentation { final String raw; final String asHtml; final String asOneLiner; - final bool hasMoreThanOneLineDocs; factory Documentation(String markdown) { String tempHtml = _renderMarkdownToHtml(markdown); @@ -175,8 +174,7 @@ class Documentation { return new Documentation._internal(element.documentation, tempHtml); } - Documentation._( - this.raw, this.asHtml, this.hasMoreThanOneLineDocs, this.asOneLiner); + Documentation._(this.raw, this.asHtml, this.asOneLiner); factory Documentation._internal(String markdown, String rawHtml) { var asHtmlDocument = parse(rawHtml); @@ -206,18 +204,14 @@ class Documentation { } var asHtml = asHtmlDocument.body.innerHtml; - // Fixes issue with line ending differences between mac and windows, affecting tests + // Fixes issue with line ending differences between mac and windows. if (asHtml != null) asHtml = asHtml.trim(); - var asOneLiner = ''; - var moreThanOneLineDoc = asHtmlDocument.body.children.length > 1; + var asOneLiner = asHtmlDocument.body.children.isEmpty + ? '' + : asHtmlDocument.body.children.first.innerHtml; - if (asHtmlDocument.body.children.isNotEmpty) { - asOneLiner = asHtmlDocument.body.children.first.innerHtml; - } - - return new Documentation._( - markdown, asHtml, moreThanOneLineDoc, asOneLiner); + return new Documentation._(markdown, asHtml, asOneLiner); } } diff --git a/lib/src/model.dart b/lib/src/model.dart index 25c571c318..2d242d1d65 100644 --- a/lib/src/model.dart +++ b/lib/src/model.dart @@ -659,7 +659,6 @@ abstract class Documentable { String get documentation; String get documentationAsHtml; bool get hasDocumentation; - bool get hasMoreThanOneLineDocs; String get oneLineDoc; } @@ -1363,9 +1362,6 @@ abstract class ModelElement implements Comparable, Nameable, Documentable { bool get hasDocumentation => documentation != null && documentation.isNotEmpty; - @override - bool get hasMoreThanOneLineDocs => _documentation.hasMoreThanOneLineDocs; - bool get hasParameters => parameters.isNotEmpty; String get href; @@ -1788,8 +1784,6 @@ class Package implements Nameable, Documentable { // plain text or markdown. bool get hasDocumentationFile => documentationFile != null; - bool get hasMoreThanOneLineDocs => true; - // TODO: make this work String get href => 'index.html'; diff --git a/lib/templates/_callable.html b/lib/templates/_callable.html index 8b8280f787..ad9f1b8799 100644 --- a/lib/templates/_callable.html +++ b/lib/templates/_callable.html @@ -4,7 +4,7 @@ -

{{{ oneLineDoc }}}{{>has_more_docs}}

+

{{{ oneLineDoc }}}

{{#isInherited}}
inherited
{{/isInherited}} diff --git a/lib/templates/_constant.html b/lib/templates/_constant.html index 845cd66559..12473592de 100644 --- a/lib/templates/_constant.html +++ b/lib/templates/_constant.html @@ -3,7 +3,7 @@ → {{{ linkedReturnType }}}
-

{{{ oneLineDoc }}}{{>has_more_docs}}

+

{{{ oneLineDoc }}}

{{{ constantValue }}}
diff --git a/lib/templates/_has_more_docs.html b/lib/templates/_has_more_docs.html deleted file mode 100644 index 0678a72d3c..0000000000 --- a/lib/templates/_has_more_docs.html +++ /dev/null @@ -1,3 +0,0 @@ -{{#hasMoreThanOneLineDocs}} - -{{/hasMoreThanOneLineDocs}} diff --git a/lib/templates/_property.html b/lib/templates/_property.html index 3d3d9df746..95ac054a48 100644 --- a/lib/templates/_property.html +++ b/lib/templates/_property.html @@ -3,6 +3,6 @@ → {{{ linkedReturnType }}} -

{{{ oneLineDoc }}}{{>has_more_docs}}

+

{{{ oneLineDoc }}}

{{>readable_writable}}
diff --git a/lib/templates/class.html b/lib/templates/class.html index c25ae95937..f420e9dac9 100644 --- a/lib/templates/class.html +++ b/lib/templates/class.html @@ -114,7 +114,7 @@

Constructors

{{{linkedName}}}({{{ linkedParams }}})
-

{{{ oneLineDoc }}}{{>has_more_docs}}

+

{{{ oneLineDoc }}}

{{#isConst}}
const
{{/isConst}} diff --git a/lib/templates/library.html b/lib/templates/library.html index 813c5f3db3..40bc9a3573 100644 --- a/lib/templates/library.html +++ b/lib/templates/library.html @@ -91,7 +91,7 @@

Enums

{{{linkedName}}}
-

{{{ oneLineDoc }}}{{>has_more_docs}}

+

{{{ oneLineDoc }}}

{{/library.enums}} @@ -108,7 +108,7 @@

Classes

{{{linkedName}}}
-

{{{ oneLineDoc }}}{{>has_more_docs}}

+

{{{ oneLineDoc }}}

{{/library.classes}} @@ -125,7 +125,7 @@

Exceptions / Errors

{{{linkedName}}}
-

{{{ oneLineDoc }}}{{>has_more_docs}}

+

{{{ oneLineDoc }}}

{{/library.exceptions}} diff --git a/test/model_test.dart b/test/model_test.dart index 78502526d9..febfcb3274 100644 --- a/test/model_test.dart +++ b/test/model_test.dart @@ -165,11 +165,6 @@ void main() { 'WOW FAKE PACKAGE IS BEST PACKAGE')); }); - test('has more than one line docs (or not)', () { - expect(fakeLibrary.hasMoreThanOneLineDocs, true); - expect(exLibrary.hasMoreThanOneLineDocs, false); - }); - test('has properties', () { expect(exLibrary.hasProperties, isTrue); });