teachbooks.external_content.config module

Parse external content config files.

teachbooks.external_content.config.check_plugins(config_file: Path, git_repos: list[Path]) tuple[set[str], set[str]]

Check external configs for missing plugins/myst extensions and return them.

The user will be warned if any plugins or extensions are missing/not the same version pin.

Parameters:
  • config_file – Path to the config yaml file.

  • git_repos – List of cloned git repositories.

Returns:

The missing plugins and myst extensions.

teachbooks.external_content.config.find_config(repo: Path) Path | None

Find path to config file.

Parameters:

repo – Path to repository.

Returns:

Path to config file if found, otherwise None.

teachbooks.external_content.config.find_plugins(config_file: Path) tuple[set[str], set[str]]

Collect all plugins (sphinx, myst) from config file.

teachbooks.external_content.config.get_myst_extensions(config_file: Path) set[str]

Find the myst extensions in the config file.

Parameters:

config_file – Path to the config yaml file.

Returns:

myst extension names as a set.

teachbooks.external_content.config.get_sphinx_plugins(config_file: Path) set[str]

Find the sphinx plugins in the config file.

Parameters:

config_file – Path to the config yaml file.

Returns:

Sphinx plugin names as a set.

teachbooks.external_content.config.get_teachbooks_config(config_file: Path) dict[str, str]

Load teachbooks entries from _config.yml.

Parameters:

config_file – Path to _config.yml file

Returns:

Loaded configuration.