Skip to content

Commit

Permalink
refactor: place rocm latest version in projects.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
samjwu committed Jun 27, 2023
1 parent cc2d1bd commit 392e0aa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/rocm_docs/data/projects.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ projects:
roctracer: https://rocm.docs.amd.com/projects/roctracer/en/${version}
rocm-docs-core: https://rocm.docs.amd.com/projects/rocm-docs-core/en/${version}
rocm-validation-suite: https://rocm.docs.amd.com/projects/ROCmValidationSuite/en/${version}
rocm: https://rocm.docs.amd.com/en/${version}
rocm:
target: https://rocm.docs.amd.com/en/${version}
development_branch: develop
latest_version: 5.5.1
release_candidate: 5.6
rocprim: https://rocm.docs.amd.com/projects/rocPRIM/en/${version}
rocrand: https://rocm.docs.amd.com/projects/rocRAND/en/${version}
rocsolver: https://rocm.docs.amd.com/projects/rocSOLVER/en/${version}
Expand Down
7 changes: 4 additions & 3 deletions src/rocm_docs/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,9 +277,10 @@ def _get_context(
}


def _update_banner_config(
def _update_theme_configs(
app: Sphinx, current_project: str, branch: str, url: str
) -> None:
"""Update configurations for use in theme.py"""
schema_file_loc = "data/projects.schema.json"
schema_file = importlib_resources.files("rocm_docs") / schema_file_loc
with open(schema_file) as file:
Expand All @@ -304,7 +305,7 @@ def _update_banner_config(
development_branch
]

latest_version = "5.5.1"
latest_version = project_dict["projects"]["rocm"]["latest_version"]
latest_version_string = f"docs-{latest_version}"
announcement_info = ""

Expand Down Expand Up @@ -359,7 +360,7 @@ def _update_config(app: Sphinx, _: Config) -> None:
# Store the context to be referenced later
app.config.projects_context = context # type: ignore[attr-defined]

_update_banner_config(
_update_theme_configs(
app, current_project_name, context["branch"], context["url"]
)

Expand Down

0 comments on commit 392e0aa

Please sign in to comment.