Author: Kevin Schoon [kevinschoon@gmail.com]
Hash: b173c4ba8985df63761bfb705232cb3bb813e142
Timestamp: Thu, 01 Jul 2021 18:30:27 +0000 (3 years ago)

+26 -6 +/-1 browse
add comments to note.mli
1diff --git a/lib/note.mli b/lib/note.mli
2index 377c501..978ef91 100644
3--- a/lib/note.mli
4+++ b/lib/note.mli
5 @@ -1,33 +1,50 @@
6 module Frontmatter : sig
7 type t = { path : string; description : string option; tags : string list }
8+ (* metadata in the heading of each markdown file seperated by --- *)
9 end
10
11 type t
12+ (* a note represented as a tuple of frontmatter and raw text content *)
13
14 type tree = Tree of (t * tree list)
15+ (* notes arranged in a hierarchical structure *)
16
17 val fst : tree -> t
18-
19- type options = {
20- state_dir : string;
21- editor : string;
22- on_modification : string option;
23- }
24+ (* return the top level note of a given tree *)
25
26 val to_string : t -> string
27+ (* return a note with frontmatter and content *)
28
29 val of_string : ?path:string option -> string -> t
30+ (* parse a note with optional frontmatter data *)
31
32 val to_json : t -> Ezjsonm.value
33+ (* get a note as json data with structured data extracted from it *)
34
35 val frontmatter : t -> Frontmatter.t
36+
37+ (* get decoded frontmatter structure *)
38 val content : t -> string
39+ (* get the raw text content without frontmatter heading *)
40
41 val flatten : ?accm:t list -> tree -> t list
42+ (* flatten a tree into a list of notes *)
43+
44+ (*
45+ * high level adapter options for interaction from the CLI
46+ *)
47+ type options = {
48+ state_dir : string;
49+ editor : string;
50+ on_modification : string option;
51+ }
52+ (* runtime options for interacting with the filesystem and manifest document*)
53
54 val load : path:string -> options -> tree
55+ (* load all notes below the given path *)
56
57 val find : path:string -> options -> t option
58+ (* find a single note *)
59
60 val create :
61 ?description:string option ->
62 @@ -36,7 +53,10 @@ val create :
63 path:string ->
64 options ->
65 unit
66+ (* create a new note opening it in an editor if no content is given *)
67
68 val remove : path:string -> options -> unit
69+ (* remove an existing note *)
70
71 val edit : path:string -> options -> unit
72+ (* edit an existing note opening it in the configured editor *)