diff --git a/doc-tool/resources/_layouts/api-page.html b/doc-tool/resources/_layouts/api-page.html index fb2d466b43b1..484f7ae58b8b 100644 --- a/doc-tool/resources/_layouts/api-page.html +++ b/doc-tool/resources/_layouts/api-page.html @@ -67,6 +67,7 @@ {% endif %}

+ [-] Constructors

@@ -97,6 +98,7 @@

+ [-] Members

@@ -104,7 +106,7 @@

{% for member in entity.members %}
- [+] + [+] {% for annot in member.annotations %}@{{ annot | split: '.' | last }} {% endfor %} @@ -169,21 +171,21 @@

-
- {{ member.comment.short }} -
{{ member.comment.body }}
diff --git a/doc-tool/resources/_layouts/rand.sh b/doc-tool/resources/_layouts/rand.sh new file mode 100644 index 000000000000..378de257bbfa --- /dev/null +++ b/doc-tool/resources/_layouts/rand.sh @@ -0,0 +1,4 @@ +currdate=$(date "+%Y-%m-%d\ %H:%M:%S") +currDateComment="" +sed -i '.original' "1s/^/$currDateComment\\ +/" main.html diff --git a/doc-tool/resources/css/api-page.css b/doc-tool/resources/css/api-page.css index 48a3162bbcc1..3c24ef281049 100644 --- a/doc-tool/resources/css/api-page.css +++ b/doc-tool/resources/css/api-page.css @@ -66,6 +66,23 @@ h1.section { margin: 30px 0; } +h1.section > span.expand-button.visible { + color: rgba(167, 161, 161, 0.5); + font-family: "Source Code Pro", sans-serif; + font-size: 25px; +} + +h1.section > span.expand-button.visible:hover { + color: rgb(167, 161, 161); + cursor: pointer; + user-select: none; +} + +h1.section > span.expand-button, +h1.section > span.expand-button.hover { + color: transparent; +} + .empty { display: none; } @@ -112,18 +129,18 @@ div.entity-section > div.member > div.member-title span.no-right { margin-right: -11px; } -div.entity-section > div.member > div.member-title > span.expand-button { +div.entity-section > div.member > div.member-title > span.expand-button.visible { color: rgba(167, 161, 161, 0.5); } -div.entity-section > div.member > div.member-title > span.expand-button:hover { +div.entity-section > div.member > div.member-title > span.expand-button.visible:hover { color: rgb(167, 161, 161); cursor: pointer; user-select: none; } -div.entity-section > div.member > div.member-title > span.expand-button.invisible, -div.entity-section > div.member > div.member-title > span.expand-button.invisible:hover { +div.entity-section > div.member > div.member-title > span.expand-button, +div.entity-section > div.member > div.member-title > span.expand-button:hover { color: transparent; } @@ -142,3 +159,7 @@ div.entity-section > div.member > div.member-body > div.member-body-long { div.entity-section > div.member > div.member-body > div.member-body-long.toggled { display: block; } + +div.entity-section.toggled { + display: none; +} diff --git a/doc-tool/src/dotty/tools/dottydoc/model/JavaConverters.scala b/doc-tool/src/dotty/tools/dottydoc/model/JavaConverters.scala index 91a964393738..dfb6e35df7b1 100644 --- a/doc-tool/src/dotty/tools/dottydoc/model/JavaConverters.scala +++ b/doc-tool/src/dotty/tools/dottydoc/model/JavaConverters.scala @@ -151,7 +151,6 @@ object JavaConverters { "path" -> ent.path.asJava, "children" -> ent.children.map(_.asJava()).asJava, "comment" -> ent.comment.map(_.asJava).asJava, - "hasShortenedDocstring" -> ent.hasShortenedDocstring, "signature" -> ent.signature ) val members = ent match { diff --git a/doc-tool/src/dotty/tools/dottydoc/model/entities.scala b/doc-tool/src/dotty/tools/dottydoc/model/entities.scala index d0f1a82c7cab..cede5f48f8cf 100644 --- a/doc-tool/src/dotty/tools/dottydoc/model/entities.scala +++ b/doc-tool/src/dotty/tools/dottydoc/model/entities.scala @@ -21,9 +21,6 @@ trait Entity { entity => def annotations: List[String] - def hasShortenedDocstring: Boolean = - comment.map(d => d.body.length > d.short.length).getOrElse(false) - def signature: String = entity.name + (entity match { case o: Object => "$" diff --git a/doc-tool/test/JavaConverterTest.scala b/doc-tool/test/JavaConverterTest.scala index f9046a8918d0..502488e32c72 100644 --- a/doc-tool/test/JavaConverterTest.scala +++ b/doc-tool/test/JavaConverterTest.scala @@ -230,7 +230,6 @@ class JavaConverterTest { assertEquals(expected.kind, actual.get("kind")) assertSameSeq(expected.annotations, actual.get("annotations")) assertSameSeq(expected.path, actual.get("path")) - assertEquals(expected.hasShortenedDocstring, actual.get("hasShortenedDocstring")) // Only test if a comment is present expected.comment match { case Some(c) => assertNotEquals(null, actual.get("comment"))