Add documentation for self.document