def gen_api_docs(code_url_prefix, site_path, output_dir, project_short_name, project_full_name, search_hints): """Generates api docs for the tensorflow docs package.""" build_api_docs_lib.hide_module_model_and_layer_methods() branch = code_url_prefix.strip('/').split('/')[-2] official_url_prefix = ( f'https://github.com/tensorflow/models/blob/{branch}/official/') vision_base_dir = pathlib.Path(tfm.vision.__file__).parent # The `layers` submodule (and others) are actually defined in the `official` # package. Find the path to `official`. official_base_dir = [ p for p in pathlib.Path(tfm.vision.layers.__file__).parents if p.name == 'official' ][0] doc_generator = generate_lib.DocGenerator( root_title=project_full_name, py_modules=[(project_short_name, tfm.vision)], base_dir=[ vision_base_dir, official_base_dir, ], code_url_prefix=[code_url_prefix, official_url_prefix], search_hints=search_hints, site_path=site_path, callbacks=[custom_filter], ) doc_generator.build(output_dir) logging.info('Output docs to: %s', output_dir)
def gen_api_docs(code_url_prefix, site_path, output_dir, project_short_name, project_full_name, search_hints): """Generates api docs for the tensorflow docs package.""" build_api_docs_lib.hide_module_model_and_layer_methods() doc_generator = generate_lib.DocGenerator( root_title=project_full_name, py_modules=[(project_short_name, tfvision)], base_dir=os.path.dirname(tfvision.__file__), code_url_prefix=code_url_prefix, search_hints=search_hints, site_path=site_path, callbacks=[public_api.explicit_package_contents_filter], ) doc_generator.build(output_dir) logging.info('Output docs to: %s', output_dir)