docs.scripts.dunderlab_docs.handle_apidoc_command(args: list[str], image: str, apidoc_options: str = '') None[source]

Handle ‘apidoc’ command for Sphinx documentation.

Parameters:
  • args (list[str]) – List of arguments passed from the command line.

  • image (str) – Docker image to use for running the command.

docs.scripts.dunderlab_docs.handle_build_command(args: list[str], image: str) None[source]

Handle ‘build’ command for Sphinx documentation.

Parameters:
  • args (list[str]) – List of arguments passed from the command line.

  • image (str) – Docker image to use for running the command.

docs.scripts.dunderlab_docs.handle_server_command(args: list[str]) None[source]

Handle ‘server’ command to launch a local server for Sphinx documentation.

Parameters:

args (list[str]) – List of arguments passed from the command line.

docs.scripts.dunderlab_docs.main()[source]

Main function to handle Docker commands for Sphinx documentation.

Parses arguments from the command line and executes corresponding Docker commands based on the provided input. Supported commands include ‘quickstart’, ‘apidoc’, ‘build’, and ‘server’.

docs.scripts.dunderlab_docs.parse_arguments() Namespace[source]

Parse command-line arguments for Docker Sphinx Documentation Helper.

This function uses argparse to parse command-line arguments intended for Docker commands. The function expects arguments for commands, including the command itself, module or directory, and format or port details.

Returns:

An object containing the parsed command-line arguments.

Return type:

argparse.Namespace

Example

>>> args = parse_arguments()
>>> print(args.args)
docs.scripts.dunderlab_docs.run_docker_command(image: str, command: str, volumes: str, arguments: str = '') None[source]

Execute a Docker command with specified parameters.

This function runs a Docker command using the os.system call. It takes the Docker image name, the command to execute, and volume mappings as inputs.

Parameters:
  • image (str) – The name of the Docker image to use.

  • command (str) – The Docker command to be executed.

  • volumes (str) – The volume mappings for the Docker command.

Example

>>> run_docker_command("python:3.8", "echo Hello, World!", "/myhostpath:/mycontainerpath")