I have done finding all headlines from a markdown document by creating AST nodes by using markdown package.Is that the task you are looking for?My code is in this docs https://docs.google.com/document/d/1IPCBUVoUe_z-qQE52_FcqQRQYHFi0Ylpi-f4rHg4yFs/edit?usp=sharing
Please share your opinion.Thank you.