Skip to content

Commit f58be3c

Browse files
committed
fix #138
1 parent 2059bd4 commit f58be3c

File tree

1 file changed

+24
-21
lines changed

1 file changed

+24
-21
lines changed

Sources/SwiftinitPages/Sections/Swiftinit.GroupLists.swift

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,29 @@ extension Swiftinit.GroupLists:HTML.OutputStreamable
361361
}
362362
}
363363

364+
let extensionsEmpty:Bool = self.extensions.allSatisfy(\.isEmpty)
365+
366+
if let other:Unidoc.TopicGroup
367+
{
368+
html[.section, { $0.class = "group topic" }]
369+
{
370+
AutomaticHeading.seeAlso.window(&$0,
371+
listing: other.members,
372+
limit: 12,
373+
open: self.peerList.isEmpty && extensionsEmpty)
374+
{
375+
switch $1
376+
{
377+
case .scalar(let scalar):
378+
$0[.li] = self.context.card(scalar)
379+
380+
case .text(let text):
381+
$0[.li] { $0[.span] { $0[.code] = text } }
382+
}
383+
}
384+
}
385+
}
386+
364387
if !self.peerList.isEmpty
365388
{
366389
html[.section, { $0.class = "group sisters" }]
@@ -383,33 +406,13 @@ extension Swiftinit.GroupLists:HTML.OutputStreamable
383406
heading.window(&$0,
384407
listing: self.peerList,
385408
limit: 12,
386-
open: self.extensions.allSatisfy(\.isEmpty))
409+
open: extensionsEmpty)
387410
{
388411
$0[.li] = self.context.card($1)
389412
}
390413
}
391414
}
392415

393-
if let other:Unidoc.TopicGroup
394-
{
395-
html[.section, { $0.class = "group topic" }]
396-
{
397-
AutomaticHeading.seeAlso.window(&$0,
398-
listing: other.members,
399-
limit: 12)
400-
{
401-
switch $1
402-
{
403-
case .scalar(let scalar):
404-
$0[.li] = self.context.card(scalar)
405-
406-
case .text(let text):
407-
$0[.li] { $0[.span] { $0[.code] = text } }
408-
}
409-
}
410-
}
411-
}
412-
413416
for group:Unidoc.ExtensionGroup in self.extensions where !group.isEmpty
414417
{
415418
html[.section, { $0.class = "group extension" }]

0 commit comments

Comments
 (0)