def add_content(self, more_content: Any, no_docstring: bool = True): """ Add extra content (from docstrings, attribute docs etc.), but not the NamedTuple's docstring. :param more_content: :param no_docstring: """ Documenter.add_content(self, more_content, True) # set sourcename and add content from attribute documentation sourcename = self.get_sourcename() params, pre_output, post_output = self._get_docstring() for line in pre_output: self.add_line(line, sourcename)
def add_content(self, more_content: Any, no_docstring: bool = True): r""" Add extra content (from docstrings, attribute docs etc.), but not the :class:`typing.NamedTuple`\'s docstring. :param more_content: :param no_docstring: """ # noqa: D400 with warnings.catch_warnings(): # TODO: work out what to do about this warnings.simplefilter("ignore", RemovedInSphinx50Warning) Documenter.add_content(self, more_content, True) # set sourcename and add content from attribute documentation sourcename = self.get_sourcename() params, pre_output, post_output = self._get_docstring() for line in pre_output: self.add_line(line, sourcename)
def add_content(self, more_content: Any, no_docstring: bool = False) -> None: # type: ignore """ Add extra content (from docstrings, attribute docs etc.), but not the class docstring. :param more_content: :param no_docstring: """ with warnings.catch_warnings(): # TODO: work out what to do about this warnings.simplefilter("ignore", RemovedInSphinx50Warning) Documenter.add_content(self, more_content, True) # set sourcename and add content from attribute documentation sourcename = self.get_sourcename() params, pre_output, post_output = self._get_docstring() self.add_line('', sourcename) for line in list(self.process_doc([pre_output])): self.add_line(line, sourcename) self.add_line('', sourcename)