Lines Matching +full:app +full:- +full:path
6 SPDX-License-Identifier: Apache-2.0
23 - ``external_content_contents``: A list of external contents. Each entry is
25 - ``external_content_directives``: A list of directives that should be analyzed
27 - ``external_content_keep``: A list of file globs (relative to the destination
29 directory. This option can be useful for auto-generated files in the
38 from pathlib import Path
51 fname: Path, argument
52 basepath: Path, argument
55 dstpath: Path | None = None,
56 ) -> None:
61 basepath: Base path to be used to resolve content location.
64 dstpath: Destination path for fname if its path is not the actual destination.
79 fpath_adj = Path(os.path.relpath(basepath / fpath, dstpath)).as_posix()
94 def sync_contents(app: Sphinx) -> None:
98 app: Sphinx application instance.
101 srcdir = Path(app.srcdir).resolve()
106 for k in app.config.external_content_keep
111 for content in app.config.external_content_contents:
137 app.config.external_content_directives,
138 app.config.source_encoding,
144 src_adjusted = Path(td) / src.name
149 app.config.external_content_directives,
150 app.config.source_encoding,
160 for file in to_delete - to_keep:
164 def setup(app: Sphinx) -> dict[str, Any]:
165 app.add_config_value("external_content_contents", [], "env")
166 app.add_config_value("external_content_directives", DEFAULT_DIRECTIVES, "env")
167 app.add_config_value("external_content_keep", [], "")
169 app.connect("builder-inited", sync_contents)