Currently this adds sections based on h1 and h2 elements - this could be split out into a separate library
See also: https://github.com/agentofuser/rehype-section and https://github.com/rstacruz/rehype-sectionize-headings for existing libraries that do something similar