python script to parse document for markdown