def generate_doc(self, source_path): # type: (Path) -> None """ Generate one module doc at once. Arguments: source_path -- Path to source file. Raises: GeneratorError -- If `source_path` not found in current repo. """ for module_record in self._module_records: if module_record.source_path != source_path: continue output_path = self._loader.get_output_path( module_record.source_path) md_document = MDDocument(output_path) self._generate_doc(module_record, md_document) md_document.write() return raise GeneratorError("Record not found for {}".format( source_path.name))
def generate_docs(self): # type: () -> None """ Generate all doc files at once. """ self._logger.debug("Generating docs for {} to {}".format( self._project_name, self._root_path_finder.relative(self._output_path))) for module_record in self._module_records: output_path = self._loader.get_output_path( module_record.source_path) md_document = MDDocument(output_path) self._generate_doc(module_record, md_document) md_document.write()