Skip to content

Commit 4cc5358

Browse files
authored
Sort types and values (#1194)
1 parent 7797c10 commit 4cc5358

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/ApiDocs.res

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,12 +510,20 @@ let processStaticProps = (~slug: array<string>) => {
510510
| _ => assert(false)
511511
}
512512
)
513+
let itemName = item =>
514+
switch item {
515+
| Value({name}) | Type({name}) => name
516+
}
517+
518+
let sortedItems =
519+
items->Array.toSorted((a, b) => itemName(a)->String.localeCompare(itemName(b)))
520+
513521
let module_ = {
514522
id,
515523
name,
516524
docstrings,
517525
deprecated: deprecated->Null.fromOption,
518-
items,
526+
items: sortedItems,
519527
}
520528

521529
Ok({module_, toctree: Obj.magic({name: "root", path: [], children: []})})

0 commit comments

Comments
 (0)