beanbag_docutils.sphinx.ext.collect_files

Sphinx extension to collect additional files in the build directory.

This is used to copy files (indicated by glob patterns) from the source directory into the destination build directory. Each destination file will be in the same relative place in the tree.

This is useful when you have non-ReST/image files that you want part of your built set of files, perhaps containing metadata or packaging that you want to ship along with the documentation.

Setup

To use this, you just need to add the extension in conf.py:

extensions = [
    ...
    'beanbag_docutils.sphinx.ext.collect_files',
    ...
]

And then configure collect_file_patterns to be a list of filenames/glob patterns.

Configuration

collect_file_patterns

List of filenames or glob patterns to include from the source directory into the build directory.

Functions

collect_files(app, env)

Collect configured files and put them into the build directory.

setup(app)

Set up the Sphinx extension.

beanbag_docutils.sphinx.ext.collect_files.collect_files(app, env)

Collect configured files and put them into the build directory.

Parameters:
  • app (sphinx.application.Sphinx) – The Sphinx application to register roles and configuration on.

  • env (sphinx.environment.BuildEnvironment, unused) – The build environment for the generated docs.

beanbag_docutils.sphinx.ext.collect_files.setup(app)

Set up the Sphinx extension.

This listens for the events needed to collect files.

Parameters:

app (sphinx.application.Sphinx) – The Sphinx application to listen to events on.

Returns:

Information about the extension.

Return type:

dict