module documentation

File utility functions for Sphinx.

Unknown Field: copyright
Copyright 2007-2022 by the Sphinx team, see AUTHORS.
Unknown Field: license
BSD, see LICENSE for details.
Function copy​_asset Copy asset files to destination recursively.
Function copy​_asset​_file Copy an asset file to destination.
def copy_asset(source, destination, excluded=(lambda path: False), context=None, renderer=None, onerror=None):

Copy asset files to destination recursively.

On copying, it expands the template variables if context argument is given and the asset is a template file.

Parameters
source:strThe path to source file or directory
destination:strThe path to destination directory
excluded:PathMatcherThe matcher to determine the given path should be copied or not
context:DictThe template variables. If not given, template files are simply copied
renderer:BaseRendererThe template engine. If not given, SphinxRenderer is used by default
onerror:Callable[[str, Exception], None]The error handler.
def copy_asset_file(source, destination, context=None, renderer=None):

Copy an asset file to destination.

On copying, it expands the template variables if context argument is given and the asset is a template file.

Parameters
source:strThe path to source file
destination:strThe path to destination file or directory
context:DictThe template variables. If not given, template files are simply copied
renderer:BaseRendererThe template engine. If not given, SphinxRenderer is used by default