File tree 4 files changed +54
-10
lines changed
src/dotty/tools/scaladoc/renderers
scaladoc-testcases/src/tests
4 files changed +54
-10
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * These are useful methods that exist for both $some and $none.
3
+ * * [[isDefined ]] — True if not empty
4
+ * - [[isEmpty ]] — True if empty
5
+ * - [[nonEmpty ]] — True if not empty
6
+ * - [[orElse ]] — Evaluate and return alternate optional value if empty
7
+ * - [[getOrElse ]] — Evaluate and return alternate value if empty
8
+ * - [[get ]] — Return value, throw exception if empty
9
+ * - [[fold ]] — Apply function on optional value, return default if empty
10
+ * - [[map ]] — Apply a function on the optional value
11
+ * - [[flatMap ]] — Same as map but function must return an optional value
12
+ * - [[foreach ]] — Apply a procedure on option value
13
+ * - [[collect ]] — Apply partial pattern match on optional value
14
+ * - [[filter ]] — An optional value satisfies predicate
15
+ * - [[filterNot ]] — An optional value doesn't satisfy predicate
16
+ * - [[exists ]] — Apply predicate on optional value, or false if empty
17
+ * - [[forall ]] — Apply predicate on optional value, or true if empty
18
+ * - [[contains ]] — Checks if value equals optional value, or false if empty
19
+ * - [[zip ]] — Combine two optional values to make a paired optional value
20
+ * - [[unzip ]] — Split an optional pair to two optional values
21
+ * - [[unzip3 ]] — Split an optional triple to three optional values
22
+ * - [[toList ]] — Unary list of optional value, otherwise the empty list
23
+ */
24
+ trait O
25
+
26
+ /**
27
+ * Some text
28
+ *
29
+ *
30
+ * Next paragraph
31
+ *
32
+ *
33
+ * Last paragraph
34
+ */
35
+ trait K
Original file line number Diff line number Diff line change @@ -9,8 +9,9 @@ window.addEventListener("DOMContentLoaded", () => {
9
9
var elements = document . getElementsByClassName ( "documentableElement" )
10
10
if ( elements ) {
11
11
for ( i = 0 ; i < elements . length ; i ++ ) {
12
- elements [ i ] . onclick = function ( ) {
13
- this . classList . toggle ( "expand" )
12
+ elements [ i ] . onclick = function ( e ) {
13
+ if ( ! $ ( e . target ) . is ( "a" ) )
14
+ this . classList . toggle ( "expand" )
14
15
}
15
16
}
16
17
}
Original file line number Diff line number Diff line change 12
12
--inactive-fg : # 777 ;
13
13
--title-fg : # 00485E ;
14
14
15
- --link-sig-fd : # 7c99a5 ;
15
+ --link-sig-fd : # 2da0d1 ;
16
16
--link-sig-hover-fd : # 7c99a5 ;
17
17
18
18
--leftbar-bg : # 003048 ;
155
155
156
156
/* Navigation */
157
157
# sideMenu2 {
158
- overflow-y : auto;
158
+ overflow : auto;
159
+ overflow-x : hidden;
160
+ overflow-y : scroll;
159
161
scrollbar-width : thin;
160
162
height : 100% ;
161
163
font-size : var (--leftbar-font-size );
206
208
margin-top : 1px ;
207
209
margin-bottom : 1px ;
208
210
width : 100% ;
209
- /* This trick adds selected bachground stratching to the lef side of screen */
211
+ /* This trick adds selected background stretching to the left side of screen */
210
212
margin-left : calc (0px - var (--side-width ));
211
213
padding-left : var (--side-width );
212
214
width : calc (2 * var (--side-width ));
@@ -490,7 +492,7 @@ footer .pull-right {
490
492
}
491
493
492
494
.documentableElement .signature {
493
- color : gray ;
495
+ color : # 5a5a5a ;
494
496
display : table-cell;
495
497
white-space : pre-wrap;
496
498
}
@@ -775,3 +777,6 @@ footer .socials {
775
777
}
776
778
}
777
779
780
+ footer {
781
+ background-color : white;
782
+ }
Original file line number Diff line number Diff line change @@ -173,16 +173,19 @@ class MemberRenderer(signatureRenderer: SignatureRenderer)(using DocContext) ext
173
173
)
174
174
)
175
175
176
- private case class MGroup (header : AppliedTag , members : Seq [Member ])
176
+ private case class MGroup (header : AppliedTag , members : Seq [Member ], groupName : String )
177
177
178
178
private def actualGroup (name : String , members : Seq [Member | MGroup ]): Seq [AppliedTag ] =
179
179
if members.isEmpty then Nil else
180
180
div(cls := " documentableList" )(
181
181
h3(cls:= " groupHeader" )(name),
182
- members.map {
182
+ members.sortBy {
183
+ case m : Member => m.name
184
+ case MGroup (_, _, name) => name
185
+ }.map {
183
186
case element : Member =>
184
187
member(element)
185
- case MGroup (header, members) =>
188
+ case MGroup (header, members, _ ) =>
186
189
div(
187
190
header,
188
191
members.map(member)
@@ -255,7 +258,7 @@ class MemberRenderer(signatureRenderer: SignatureRenderer)(using DocContext) ext
255
258
}.collect {
256
259
case (Some (on), members) =>
257
260
val sig = Signature (s " extension ( ${on.name}: " ) ++ on.signature ++ Signature (" )" )
258
- MGroup (span(sig.map(renderElement)), members.toSeq)
261
+ MGroup (span(sig.map(renderElement)), members.sortBy(_.name). toSeq, on.name )
259
262
}.toSeq
260
263
261
264
div(cls := " membersList" )(renderTabs(
You can’t perform that action at this time.
0 commit comments