Module Djot.Folder

type 'a result = [
  1. | `Default
  2. | `Fold of 'a
]
val default : 'a result

Fold the node's children.

val ret : 'a -> 'a result
type 'a t
type ('a, 'b) folder = 'b t -> 'b -> 'a -> 'b result
val make : ?inline:(Inline.t node, 'a) folder -> ?block:(Block.t node, 'a) folder -> unit -> 'a t
val fold_inline : 'a t -> 'a -> Inline.t node -> 'a
val fold_block : 'a t -> 'a -> Block.t node -> 'a

Children are visited in source order. To fold a document, fold its Doc.blocks: a footnote's blocks are there, under its Block.t.FootnoteDef.