diff --git a/doc/conf.py b/doc/conf.py index e7976f59a87..891ed0eebed 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -198,6 +198,7 @@ ('py:class', 'Path'), # sphinx.application.Sphinx.connect ('py:class', 'RoleFunction'), # sphinx.domains.Domain ('py:class', 'RSTState'), # sphinx.utils.parsing.nested_parse_to_nodes + ('py:class', 'BaseRenderer'), # sphinx.utils.fileutil.copy_asset_file ('py:class', 'Theme'), # sphinx.application.TemplateBridge ('py:class', 'SearchLanguage'), # sphinx.application.Sphinx.add_search_language ('py:class', 'StringList'), # sphinx.utils.parsing.nested_parse_to_nodes diff --git a/doc/extdev/utils.rst b/doc/extdev/utils.rst index 9e10a0ded85..4eeec0394f1 100644 --- a/doc/extdev/utils.rst +++ b/doc/extdev/utils.rst @@ -44,6 +44,9 @@ Utility functions .. autofunction:: sphinx.util.parsing.nested_parse_to_nodes +.. autofunction:: sphinx.util.fileutil.copy_asset_file + +.. autofunction:: sphinx.util.fileutil.copy_asset Utility types ------------- diff --git a/sphinx/util/fileutil.py b/sphinx/util/fileutil.py index acd52b07674..3e4d5c7c567 100644 --- a/sphinx/util/fileutil.py +++ b/sphinx/util/fileutil.py @@ -53,6 +53,8 @@ def copy_asset_file( :param context: The template variables. If not given, template files are simply copied :param renderer: The template engine. If not given, SphinxRenderer is used by default :param bool force: Overwrite the destination file even if it exists. + + .. versionadded:: 1.5 """ if not os.path.exists(source): return @@ -115,7 +117,7 @@ def copy_asset( On copying, it expands the template variables if context argument is given and the asset is a template file. - Use ``copy_asset_file`` instead to copy a single file. + Use :func:`copy_asset_file` instead to copy a single file. :param source: The path to source file or directory :param destination: The path to destination directory @@ -124,6 +126,8 @@ def copy_asset( :param renderer: The template engine. If not given, SphinxRenderer is used by default :param onerror: The error handler. :param bool force: Overwrite the destination file even if it exists. + + .. versionadded:: 1.5 """ if not os.path.exists(source): return