Skip to content

Specify children order in frontmatter #1193

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
704b7d1
Remove impossible page reference from the possible values
panglesd Aug 28, 2024
bb05e60
Frontmatter: Parse children order
panglesd Aug 28, 2024
14daab2
Link frontmatter by resolving page references
panglesd Aug 28, 2024
6c78a08
Driver: log compile-index in their own list
panglesd Aug 29, 2024
b1dcac8
Allow specification of children order in index page
panglesd Aug 29, 2024
51bd63a
Children order: do not model that with references
panglesd Aug 29, 2024
0812abe
Children order: Add some tests
panglesd Aug 29, 2024
4ff50eb
Children order: more lax syntax
panglesd Aug 30, 2024
c798509
Children order: More improvements to tests
panglesd Aug 30, 2024
208ee41
Children order: compatibility
panglesd Aug 30, 2024
c10fd76
Children order: added changelog entry
panglesd Aug 30, 2024
3ab9782
Children order review: reduce diff with style improvements
panglesd Oct 2, 2024
c405166
Children order: Addressing review comments
panglesd Oct 2, 2024
fa5cf0b
Add a warning when specifying children order in non-index pages
panglesd Oct 2, 2024
2ebdf3b
Children order: Refactor sidebar types
panglesd Oct 2, 2024
26411f7
Children order: Add omitted children at the end of the ordering
panglesd Oct 2, 2024
2118b0d
Children order: Add a warning when a children is omitted
panglesd Oct 2, 2024
eeeffce
Children order: Add warnings for duplicated and unresolved entries
panglesd Oct 3, 2024
2a0372f
Children order: compatibility
panglesd Oct 3, 2024
e4ee1b7
Do not open Path.Identifier
panglesd Oct 3, 2024
84d22e3
Compatibility again
panglesd Oct 3, 2024
a5db29c
Children order: Remove common root using ID not URL segments
panglesd Oct 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Children order: compatibility
  • Loading branch information
panglesd committed Oct 3, 2024
commit 2a0372f7d050d5a9e23ee2dfab38c72d68dc965c
3 changes: 2 additions & 1 deletion src/model/sidebar.ml
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ module PageToc = struct
in
let ordered =
ordered
|> List.sort (fun (i, _) (j, _) -> Int.compare i j)
|> List.sort (fun (i, _) (j, _) ->
(Stdlib.compare : int -> int -> int) i j)
|> List.map snd
in
let unordered =
Expand Down
1 change: 1 addition & 0 deletions src/model_desc/lang_desc.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
open Type_desc
open Odoc_model
open Odoc_utils
open Paths_desc
open Comment_desc
module T = Type_desc
Expand Down
1 change: 1 addition & 0 deletions src/odoc/compile.ml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ open Astring
open Odoc_model
open Odoc_model.Names
open Or_error
open Odoc_utils

(*
* Copyright (c) 2014 Leo White <leo@lpw25.net>
Expand Down
18 changes: 8 additions & 10 deletions src/utils/odoc_utils.ml
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,18 @@ module List = struct
| [] -> None
| x :: l -> (
match f x with Some _ as result -> result | None -> find_map f l)

let partition_map p l =
let rec part left right = function
| [] -> (rev left, rev right)
| x :: l -> (
match p x with
| `Left v -> part (v :: left) right l
| `Right v -> part left (v :: right) l)
in
part [] [] l
end

module Option = struct
let map f = function None -> None | Some x -> Some (f x)

let is_some = function None -> false | Some _ -> true
end

module Result = struct
include Result

let join = function Ok r -> r | Error _ as e -> e
end

module Fun = struct
Expand Down