Return the filename for the document name. If *absolute* is True, return as an absolute path. Else, return as a relative path to the source directory.
(self, docname: str, absolute: bool)
| 112 | return None |
| 113 | |
| 114 | def doc2path(self, docname: str, absolute: bool) -> _StrPath: |
| 115 | """Return the filename for the document name. |
| 116 | |
| 117 | If *absolute* is True, return as an absolute path. |
| 118 | Else, return as a relative path to the source directory. |
| 119 | """ |
| 120 | try: |
| 121 | filename = self._docname_to_path[docname] |
| 122 | except KeyError: |
| 123 | # Backwards compatibility: the document does not exist |
| 124 | filename = Path(docname + self._first_source_suffix) |
| 125 | |
| 126 | if absolute: |
| 127 | return _StrPath(self.srcdir / filename) |
| 128 | return _StrPath(filename) |