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.
Doc.blocks
type event =
| Enter of Attr.t
A section starts. The attributes are its heading's, identifier included; the heading follows as an Item without them.
Item
| Item of Block.t node
| 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.
Leave