Is there any module that can parse restructuredtext into a tree model?
Can docutils or sphinx do this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Docutils does indeed contain the tools to do this.
What you probably want is the parser at
docutils.parsers.rstSee this page for details on what is involved. There are also some examples at
docutils/examples.py– particularly check out theinternals()function, which is probably of interest.