Closed JeanChristopheMorinPerso closed 3 months ago
Our Sphinx docs are setup in a way that allows us to use :gh-rez:path/to.file` to link to a file in the repo.
:gh-rez:
https://github.com/AcademySoftwareFoundation/rez/blob/1d18bc267fb6e237b56e0297952be95d8e325542/docs/source/conf.py#L103
This is great, but the URL is hardcoded to one branch. We should make it flexible and instead use a logic like:
blob_ref = "main" if os.environ.get("READTHEDOCS"): if os.environ["READTHEDOCS_VERSION_TYPE"] == "external": blob_ref = os.environ["READTHEDOCS_GIT_COMMIT_HASH"] else: blob_ref = os.environ["READTHEDOCS_GIT_IDENTIFIER"] gh_rez_url = f"https://github.com/AcademySoftwareFoundation/rez/blob/{blob_ref}/%s" extlinks = { 'gh-rez': (gh_rez_url, '%s'), }
See https://docs.readthedocs.io/en/stable/reference/environment-variables.html.
Our Sphinx docs are setup in a way that allows us to use
:gh-rez:
path/to.file` to link to a file in the repo.https://github.com/AcademySoftwareFoundation/rez/blob/1d18bc267fb6e237b56e0297952be95d8e325542/docs/source/conf.py#L103
This is great, but the URL is hardcoded to one branch. We should make it flexible and instead use a logic like:
See https://docs.readthedocs.io/en/stable/reference/environment-variables.html.