generate document for Path and PlainText