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
)
| 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. |
no test coverage detected