Skip to content

Commit

Permalink
Fix default order of children
Browse files Browse the repository at this point in the history
  • Loading branch information
panglesd authored and jonludlam committed Dec 10, 2024
1 parent a650013 commit 07af270
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 20 deletions.
1 change: 0 additions & 1 deletion src/index/skeleton_of.ml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ type t = Entry.t Tree.t
let compare_entry (t1 : t) (t2 : t) =
let by_kind (t : t) =
match t.node.kind with
| Page _ when List.is_empty t.children -> -10
| Page _ | Dir -> 0
| Module _ -> 10
| Impl -> 20
Expand Down
2 changes: 1 addition & 1 deletion test/parent_id/missing_indexes.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ Root is used for the missing index in the unnamed root directory. TODO
<ul>
<li>index
<ul><li><a href="bar.html">Bar</a></li>
<li><a href="#" class="current_unit">Foo</a></li>
<li>baz<ul><li><a href="baz/bli.html">Bli</a></li></ul></li>
<li><a href="#" class="current_unit">Foo</a></li>
</ul>
</li>
</ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ Now, let's see the result
{
"node": "{\"url\":\"pkg/index.html\",\"html\":\"\"}",
"children": [
{
"node": "{\"url\":\"pkg/file.html\",\"html\":\"\"}",
"children": []
},
{
"node": "{\"url\":\"pkg/dir1/index.html\",\"html\":\"\"}",
"children": [
Expand All @@ -52,6 +48,10 @@ Now, let's see the result
"children": []
}
]
},
{
"node": "{\"url\":\"pkg/file.html\",\"html\":\"\"}",
"children": []
}
]
}
Expand Down
24 changes: 12 additions & 12 deletions test/roots_and_hierarchy/sidebar.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,6 @@ A json version of a sidebar can be obtained using the sidebar-generate command:
"content": "Package <code>pkg</code>"
},
"children": [
{
"node": {
"url": "pkg/file.html",
"kind": "leaf-page",
"content": "File"
},
"children": []
},
{
"node": {
"url": "pkg/dir1/index.html",
Expand All @@ -61,6 +53,14 @@ A json version of a sidebar can be obtained using the sidebar-generate command:
}
]
},
{
"node": {
"url": "pkg/file.html",
"kind": "leaf-page",
"content": "File"
},
"children": []
},
{
"node": {
"url": null,
Expand Down Expand Up @@ -146,8 +146,8 @@ A json version of a sidebar can be obtained using the sidebar-generate command:
<nav class="odoc-toc odoc-global-toc">
<ul>
<li><a href="#" class="current_unit">Package <code>pkg</code></a>
<ul><li><a href="file.html">File</a></li>
<li><a href="dir1/index.html">A directory</a></li>
<ul><li><a href="dir1/index.html">A directory</a></li>
<li><a href="file.html">File</a></li>
<li>libname
<ul><li><a href="libname/Unit/index.html">Unit</a></li></ul>
</li>
Expand All @@ -164,8 +164,8 @@ A json version of a sidebar can be obtained using the sidebar-generate command:
<nav class="odoc-toc odoc-global-toc">
<ul>
<li><a href="../../../index.html">Package <code>pkg</code></a>
<ul><li><a href="../../../file.html">File</a></li>
<li><a href="../../../dir1/index.html">A directory</a></li>
<ul><li><a href="../../../dir1/index.html">A directory</a></li>
<li><a href="../../../file.html">File</a></li>
<li>libname
<ul>
<li><a href="../index.html">Unit</a>
Expand Down
4 changes: 2 additions & 2 deletions test/roots_and_hierarchy/sidebar_with_indexes.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ Since -L subfolders are omitted from -P roots, the index page should not be adde
<nav class="odoc-toc odoc-global-toc">
<ul>
<li><a href="#" class="current_unit">Package <code>pkg</code></a>
<ul><li><a href="file.html">File</a></li>
<li><a href="dir1/index.html">A directory</a></li>
<ul><li><a href="dir1/index.html">A directory</a></li>
<li><a href="file.html">File</a></li>
<li><a href="libname/index.html">Library landing page</a></li>
</ul>
</li>
Expand Down

0 comments on commit 07af270

Please sign in to comment.