Module Stream.Sections

The sections Doc.blocks nests the blocks in, as events over the returned blocks: a heading leaves every open section of its level or deeper and enters its own.

type event =
  1. | Enter of Attr.t
    (*

    A section starts. The attributes are its heading's, identifier included; the heading follows as an Item without them.

    *)
  2. | Item of Block.t node
  3. | Leave
    (*

    The innermost open section ends.

    *)
type t

The open sections.

val start : t
val step : t -> Block.t node -> event list * t

The events of one block.

val finish : t -> event list

End of input: one Leave per open section.