Skip to main content

render_resource_tree

FunctionSource

render_resource_tree(
out_dir: str | PathLike[str],
variables: dict,
package: str = "pydocusaurus",
resource_root: str = "resources",
saver: SaverAbstract | None = None,
)

Render the resource tree of a package.

Recursively load a resource folder inside a package. Render Jinja2 templates and copy non-template files to out_dir while preserving folder structure.

Arguments

Requires

NameTypeRequired
Description
out_dirstr | PathLike[str]The directory where the resource files will be dumped.
variablesdictA mapping from names to the variables that the Jinja2 templates will use to render files.
packagestrThe name of the package containing the resources.
resource_rootstrA relative path inside the package specifying the root of the resource folder. For example, "resources/ts".
saverSaverAbstract | NoneThe saver used for dumping the output files. If not specified, will use the default file saver.