From 708114d554b9971d20ca02a954579da79d043017 Mon Sep 17 00:00:00 2001 From: Saad Rahim Date: Fri, 29 Nov 2024 11:38:29 -0700 Subject: [PATCH] feat: Added Instinct flavor --- src/rocm_docs/data/projects.yaml | 1 + .../flavors/instinct/footer.jinja | 1 + .../flavors/instinct/header.jinja | 29 +++++++++++++++++++ .../flavors/instinct/left-side-menu.jinja | 3 ++ src/rocm_docs/theme.py | 1 + 5 files changed, 35 insertions(+) create mode 100644 src/rocm_docs/rocm_docs_theme/flavors/instinct/footer.jinja create mode 100644 src/rocm_docs/rocm_docs_theme/flavors/instinct/header.jinja create mode 100644 src/rocm_docs/rocm_docs_theme/flavors/instinct/left-side-menu.jinja diff --git a/src/rocm_docs/data/projects.yaml b/src/rocm_docs/data/projects.yaml index d75ffb1c..012a21ab 100644 --- a/src/rocm_docs/data/projects.yaml +++ b/src/rocm_docs/data/projects.yaml @@ -33,6 +33,7 @@ projects: hip-vs: target: https://rocm.docs.amd.com/projects/hip-vs/en/${version} development_branch: master + instinct: https://dcgpu.docs.amd.com/ llvm-project: https://rocm.docs.amd.com/projects/llvm-project/en/${version} miopen: https://rocm.docs.amd.com/projects/MIOpen/en/${version} mivisionx: https://rocm.docs.amd.com/projects/MIVisionX/en/${version} diff --git a/src/rocm_docs/rocm_docs_theme/flavors/instinct/footer.jinja b/src/rocm_docs/rocm_docs_theme/flavors/instinct/footer.jinja new file mode 100644 index 00000000..c7b8ed0a --- /dev/null +++ b/src/rocm_docs/rocm_docs_theme/flavors/instinct/footer.jinja @@ -0,0 +1 @@ +{% macro license_link() -%}{%- endmacro -%} diff --git a/src/rocm_docs/rocm_docs_theme/flavors/instinct/header.jinja b/src/rocm_docs/rocm_docs_theme/flavors/instinct/header.jinja new file mode 100644 index 00000000..49cd0715 --- /dev/null +++ b/src/rocm_docs/rocm_docs_theme/flavors/instinct/header.jinja @@ -0,0 +1,29 @@ +{% macro top_level_header(branch, latest_version, release_candidate_version) -%} + {% if branch in ["develop", "master", "main", "amd-master", "amd-staging"] %} + {% set version_name = "Future Release" %} + {% elif branch == "latest" %} + {% set version_name = latest_version %} + {% else %} + {% set version_name = branch %} + {% endif %} + Instinct™ Hub +{%- endmacro -%} + + +{% set repo_url = repo_url|replace("http://", "https://") %} + +{% macro version_list() -%} + {% if theme_version_list_link %} + Version List + {% endif %} +{%- endmacro -%} + +{% +set nav_secondary_items = theme_nav_secondary_items if theme_nav_secondary_items else { + "GitHub": theme_repository_url if theme_repository_url else "#", + "Community": "https://github.com/ROCm/ROCm/discussions", + "Blogs": "https://rocm.blogs.amd.com/", + "ROCm™ docs": "https://rocm.docs.amd.com", + "Support": (theme_repository_url + "/issues/new/choose") if theme_repository_url else "#" +} +%} diff --git a/src/rocm_docs/rocm_docs_theme/flavors/instinct/left-side-menu.jinja b/src/rocm_docs/rocm_docs_theme/flavors/instinct/left-side-menu.jinja new file mode 100644 index 00000000..0376b64b --- /dev/null +++ b/src/rocm_docs/rocm_docs_theme/flavors/instinct/left-side-menu.jinja @@ -0,0 +1,3 @@ +{% +set main_doc_link = ("Instinct Hub", projects['instinct']) +%} diff --git a/src/rocm_docs/theme.py b/src/rocm_docs/theme.py index fccd5fd5..42776726 100644 --- a/src/rocm_docs/theme.py +++ b/src/rocm_docs/theme.py @@ -115,6 +115,7 @@ def _update_theme_options(app: Sphinx) -> None: supported_flavors = [ "rocm", "local", + "instinct", "rocm-docs-home", "rocm-blogs", "generic",