doc/source/custom_directives.py
def download_and_preprocess_ecosystem_docs():
    """
    This function downloads markdown readme files for various
    ecosystem libraries, saves them in specified locations and preprocesses
    them before sphinx build starts.

    If you have ecosystem libraries that live in a separate repo from Ray,
    adding them here will allow for their docs to be present in Ray docs
    without the need for duplicate files. For more details, see ``doc/README.md``.
    """

    import urllib.request
    import requests

    def get_latest_release_tag(repo: str) -> str:
        """repo is just the repo name, eg. ray-project/ray"""
        response = requests.get(f"https://api.github.com/repos/{repo}/releases/latest")
        return response.json()["tag_name"]

    def get_file_from_github(
        repo: str, ref: str, path_to_get: str, path_to_save_on_disk: str
    ) -> None:
        """If ``ref == "latest"``, use latest release"""
        if ref == "latest":
            ref = get_latest_release_tag(repo)
        urllib.request.urlretrieve(
            f"https://raw.githubusercontent.com/{repo}/{ref}/{path_to_get}",
            path_to_save_on_disk,
        )

    for x in EXTERNAL_MARKDOWN_FILES:
        get_file_from_github(*x)
        preprocess_github_markdown_file(x[-1])

    This function downloads markdown readme files for various
    ecosystem libraries, saves them in specified locations and preprocesses
    them before sphinx build starts.

    If you have ecosystem libraries that live in a separate repo from Ray,
    adding them here will allow for their docs to be present in Ray docs
    without the need for duplicate files. For more details, see ``doc/README.md``.
    
This function downloads markdown readme files for various
ecosystem libraries, saves them in specified locations and preprocesses
them before sphinx build starts.

If you have ecosystem libraries that live in a separate repo from Ray,
adding them here will allow for their docs to be present in Ray docs
without the need for duplicate files. For more details, see ``doc/README.md``.
This function downloads markdown readme files for various ecosystem libraries saves them in specified locations and preprocesses them before sphinx build starts . If you have ecosystem libraries that live in a separate repo from Ray adding them here will allow for their docs to be present in Ray docs without the need for duplicate files . For more details see ` ` doc / README . md ` ` .
def download_and_preprocess_ecosystem_docs():
    import urllib.request
    import requests
    def get_latest_release_tag(repo: str) -> str:
        response = requests.get(f"https://api.github.com/repos/{repo}/releases/latest")
        return response.json()["tag_name"]
    def get_file_from_github(
        repo: str, ref: str, path_to_get: str, path_to_save_on_disk: str
    ) -> None:
        if ref == "latest":
            ref = get_latest_release_tag(repo)
        urllib.request.urlretrieve(
            f"https://raw.githubusercontent.com/{repo}/{ref}/{path_to_get}",
            path_to_save_on_disk,
        )
    for x in EXTERNAL_MARKDOWN_FILES:
        get_file_from_github(*x)
        preprocess_github_markdown_file(x[-1])
def download_and_preprocess_ecosystem_docs ( ) : import urllib . request import requests def get_latest_release_tag ( repo : str ) -> str : """repo is just the repo name, eg. ray-project/ray""" response = requests . get ( f"https://api.github.com/repos/{repo}/releases/latest" ) return response . json ( ) [ "tag_name" ] def get_file_from_github ( repo : str , ref : str , path_to_get : str , path_to_save_on_disk : str ) -> None : """If ``ref == "latest"``, use latest release""" if ref == "latest" : ref = get_latest_release_tag ( repo ) urllib . request . urlretrieve ( f"https://raw.githubusercontent.com/{repo}/{ref}/{path_to_get}" , path_to_save_on_disk , ) for x in EXTERNAL_MARKDOWN_FILES : get_file_from_github ( * x ) preprocess_github_markdown_file ( x [ - 1 ] )
This function downloads markdown readme files for various
ecosystem libraries, saves them in specified locations and preprocesses
them before sphinx build starts.
This function downloads markdown readme files for various ecosystem libraries saves them in specified locations and preprocesses them before sphinx build starts .
"""
    This function downloads markdown readme files for various
    ecosystem libraries, saves them in specified locations and preprocesses
    them before sphinx build starts.

    If you have ecosystem libraries that live in a separate repo from Ray,
    adding them here will allow for their docs to be present in Ray docs
    without the need for duplicate files. For more details, see ``doc/README.md``.
    """ """repo is just the repo name, eg. ray-project/ray""" """If ``ref == "latest"``, use latest release"""