def on_builder_inited(app):
config = app.builder.config<EOL>target_directory = (<EOL>pathlib.Path(app.builder.env.srcdir) / config.uqbar_api_directory_name<EOL>)<EOL>initial_source_paths: List[str] = []<EOL>source_paths = config.uqbar_api_source_paths<EOL>for source_path in source_paths:<EOL><INDENT>if isinstance(source_path, types.ModuleType):<EOL><INDENT>if hasattr(source_path, "<STR_LIT>"):<EOL><INDENT>initial_source_paths.extend(getattr(source_path, "<STR_LIT>"))<EOL><DEDENT>else:<EOL><INDENT>initial_source_paths.extend(source_path.__file__)<EOL><DEDENT>continue<EOL><DEDENT>try:<EOL><INDENT>module = importlib.import_module(source_path)<EOL>if hasattr(module, "<STR_LIT>"):<EOL><INDENT>initial_source_paths.extend(getattr(module, "<STR_LIT>"))<EOL><DEDENT>else:<EOL><INDENT>initial_source_paths.append(module.__file__)<EOL><DEDENT><DEDENT>except ImportError:<EOL><INDENT>initial_source_paths.append(source_path)<EOL><DEDENT><DEDENT>root_documenter_class = config.uqbar_api_root_documenter_class<EOL>if isinstance(root_documenter_class, str):<EOL><INDENT>module_name, _, class_name = root_documenter_class.rpartition("<STR_LIT:.>")<EOL>module = importlib.import_module(module_name)<EOL>root_documenter_class = getattr(module, class_name)<EOL><DEDENT>module_documenter_class = config.uqbar_api_module_documenter_class<EOL>if isinstance(module_documenter_class, str):<EOL><INDENT>module_name, _, class_name = module_documenter_class.rpartition("<STR_LIT:.>")<EOL>module = importlib.import_module(module_name)<EOL>module_documenter_class = getattr(module, class_name)<EOL><DEDENT>member_documenter_classes = list(config.uqbar_api_member_documenter_classes or [])<EOL>for i, member_documenter_class in enumerate(member_documenter_classes):<EOL><INDENT>if isinstance(member_documenter_class, str):<EOL><INDENT>module_name, _, class_name = member_documenter_class.rpartition("<STR_LIT:.>")<EOL>module = importlib.import_module(module_name)<EOL>member_documenter_classes[i] = getattr(module, class_name)<EOL><DEDENT><DEDENT>api_builder = uqbar.apis.APIBuilder(<EOL>initial_source_paths=initial_source_paths,<EOL>target_directory=target_directory,<EOL>document_empty_modules=config.uqbar_api_document_empty_modules,<EOL>document_private_members=config.uqbar_api_document_private_members,<EOL>document_private_modules=config.uqbar_api_document_private_modules,<EOL>member_documenter_classes=member_documenter_classes or None,<EOL>module_documenter_class=module_documenter_class,<EOL>root_documenter_class=root_documenter_class,<EOL>title=config.uqbar_api_title,<EOL>logger_func=logger_func,<EOL>)<EOL>api_builder()<EOL>
Hooks into Sphinx's ``builder-inited`` event.

Builds out the ReST API source.