MCPcopy
hub / github.com/sphinx-doc/sphinx / note_dependency

Method note_dependency

sphinx/environment/__init__.py:605–618  ·  view source on GitHub ↗

Add *filename* as a dependency of the current document. This means that the document will be rebuilt if this file changes. *filename* should be absolute or relative to the source directory.

(
        self, filename: str | os.PathLike[str], *, docname: str | None = None
    )

Source from the content-addressed store, hash-verified

603 return self.current_document.new_serial_number(category)
604
605 def note_dependency(
606 self, filename: str | os.PathLike[str], *, docname: str | None = None
607 ) -> None:
608 """Add *filename* as a dependency of the current document.
609
610 This means that the document will be rebuilt if this file changes.
611
612 *filename* should be absolute or relative to the source directory.
613 """
614 if docname is None:
615 docname = self.docname
616 # this will do the right thing when *filename* is absolute too
617 filename = self.srcdir / filename
618 self.dependencies.setdefault(docname, set()).add(filename)
619
620 def note_included(self, filename: str | os.PathLike[str]) -> None:
621 """Add *filename* as a included from other document.

Callers 7

find_filesMethod · 0.95
runMethod · 0.80
read_docMethod · 0.80
process_docMethod · 0.80
process_docMethod · 0.80
process_docMethod · 0.80
runMethod · 0.80

Calls 2

setdefaultMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected