Metadata handling in generate-md + toc generation