Commit
Author: Kevin Schoon [kevinschoon@gmail.com]
Hash: a1a4a56493ab698ea4045bcacee70d164e1e40e6
Timestamp: Fri, 09 Jul 2021 20:03:31 +0000 (3 years ago)

+11 -14 +/-1 browse
simplify manifest
1diff --git a/lib/note.ml b/lib/note.ml
2index fa5491a..7443ba5 100644
3--- a/lib/note.ml
4+++ b/lib/note.ml
5 @@ -125,20 +125,17 @@ module Tree = struct
6 note
7
8 let rec resolve_manifest ~path manifest =
9- let items =
10- match manifest |> Manifest.list ~path with
11- | [] -> []
12- | items ->
13- items
14- |> List.map ~f:(fun item ->
15- let path = item.path in
16- let slug = item.slug |> Slug.to_string in
17- let note =
18- In_channel.read_all slug |> of_string ~path:(Some path)
19- in
20- Tree (note, manifest |> resolve_manifest ~path))
21- in
22- items
23+ match manifest |> Manifest.list ~path with
24+ | [] -> []
25+ | items ->
26+ items
27+ |> List.map ~f:(fun item ->
28+ let path = item.path in
29+ let slug = item.slug |> Slug.to_string in
30+ let note =
31+ In_channel.read_all slug |> of_string ~path:(Some path)
32+ in
33+ Tree (note, manifest |> resolve_manifest ~path))
34 end
35
36 (* high level adapter *)