summaryrefslogtreecommitdiff
path: root/lib/model/content.mli
blob: e972b83b3f9820558ee7a296ec1373f1f46771c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
type 'a t

val v : string -> 'a Section.t list -> 'a t list -> 'a t
val id : _ t -> string

val subcontents : 'a t -> 'a t list
(** Return the direct subcontent *)

val sections : 'a t -> 'a Section.t list

val parent : 'a t -> 'a t option
(** Get the parent type for an element, if such exists *)

val root : 'a t -> 'a t
(** Return the root element, which is the content without any parent *)

val fields : 'a t -> 'a Field.t Seq.t
(** Iterate over the fields in the content *)

val find_target : 'a t -> string -> 'a option
(** Get the content type pointed by the given field name *)