From d1348999e5f59d6f2b2a1336fb179efc1e4dd502 Mon Sep 17 00:00:00 2001 From: PProfizi Date: Mon, 25 Nov 2024 10:40:44 +0100 Subject: [PATCH 1/4] Add custom badges for supported solvers --- doc/source/_static/custom.css | 13 +++++++++++++ doc/source/conf.py | 7 +++++++ 2 files changed, 20 insertions(+) diff --git a/doc/source/_static/custom.css b/doc/source/_static/custom.css index 1a7da734d7..5ecaebae80 100644 --- a/doc/source/_static/custom.css +++ b/doc/source/_static/custom.css @@ -16,3 +16,16 @@ .sd-sphinx-override .code { background-color: var(--pst-color-surface); } + +/* Check https://www.w3schools.com/cssref/css_colors.php for colors */ +/* Ansys gold for MAPDL with black text*/ +.sd-bg-mapdl{background-color: #FFB71B} +.sd-bg-text-mapdl{color: Black} +/* Ansys orange accent color for Fluent with black text*/ +.sd-bg-lsdyna{background-color: #FB471F} +.sd-bg-text-lsdyna{color: Black} +/* Ansys blue accent color #00629F for Fluent with black text*/ +.sd-bg-fluent{background-color: #0081D0} +.sd-bg-text-fluent{color: Black} +.sd-bg-cfx{background-color: LightSeaGreen} +.sd-bg-text-cfx{color: Black} diff --git a/doc/source/conf.py b/doc/source/conf.py index b80e9b25f7..055a89bdb3 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -332,5 +332,12 @@ def verify_meilisearch_is_active(app): # sys.exit(1) +# Define custom docutils roles for solver badges +from sphinx_design.badges_buttons import BadgeRole + def setup(app): app.connect("builder-inited", verify_meilisearch_is_active) + app.add_role(name="bdg-mapdl", role=BadgeRole(color="mapdl")) + app.add_role(name="bdg-cfx", role=BadgeRole(color="cfx")) + app.add_role(name="bdg-fluent", role=BadgeRole(color="fluent")) + app.add_role(name="bdg-lsdyna", role=BadgeRole(color="lsdyna")) From 1536a7e31032996bc7fccbf19470b2aa6867ecd0 Mon Sep 17 00:00:00 2001 From: PProfizi Date: Mon, 25 Nov 2024 10:40:59 +0100 Subject: [PATCH 2/4] Test custom badges --- doc/source/user_guide/tutorials/animate/index.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/doc/source/user_guide/tutorials/animate/index.rst b/doc/source/user_guide/tutorials/animate/index.rst index 2bfa5b2f4e..873db33692 100644 --- a/doc/source/user_guide/tutorials/animate/index.rst +++ b/doc/source/user_guide/tutorials/animate/index.rst @@ -17,6 +17,8 @@ These tutorials demonstrate how to visualise the data in an animation. :text-align: center This tutorial + +++ + :bdg-mapdl:`MAPDL` :bdg-lsdyna:`LS-DYNA` :bdg-fluent:`FLUENT` :bdg-cfx:`CFX` .. toctree:: :maxdepth: 2 From 1bb00708142fc8bb383d7615ff7cd8f0942f9318 Mon Sep 17 00:00:00 2001 From: Paul Profizi <100710998+PProfizi@users.noreply.github.com> Date: Mon, 25 Nov 2024 17:06:19 +0100 Subject: [PATCH 3/4] Update conf.py --- doc/source/conf.py | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 504cf6f687..904fc16115 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -329,7 +329,6 @@ def reset_servers(gallery_conf, fname, when): from sphinx_design.badges_buttons import BadgeRole def setup(app): - app.connect("builder-inited", verify_meilisearch_is_active) app.add_role(name="bdg-mapdl", role=BadgeRole(color="mapdl")) app.add_role(name="bdg-cfx", role=BadgeRole(color="cfx")) app.add_role(name="bdg-fluent", role=BadgeRole(color="fluent")) From 443e41551ad4ef11652b5962aaf913b2f18bb05a Mon Sep 17 00:00:00 2001 From: Paul Profizi <100710998+PProfizi@users.noreply.github.com> Date: Tue, 26 Nov 2024 10:44:11 +0100 Subject: [PATCH 4/4] Update doc/source/conf.py Co-authored-by: Revathy Venugopal <104772255+Revathyvenugopal162@users.noreply.github.com> --- doc/source/conf.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 904fc16115..2663e12c97 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -329,7 +329,12 @@ def reset_servers(gallery_conf, fname, when): from sphinx_design.badges_buttons import BadgeRole def setup(app): - app.add_role(name="bdg-mapdl", role=BadgeRole(color="mapdl")) - app.add_role(name="bdg-cfx", role=BadgeRole(color="cfx")) - app.add_role(name="bdg-fluent", role=BadgeRole(color="fluent")) - app.add_role(name="bdg-lsdyna", role=BadgeRole(color="lsdyna")) + badge_roles = { + "bdg-mapdl": "mapdl", + "bdg-cfx": "cfx", + "bdg-fluent": "fluent", + "bdg-lsdyna": "lsdyna" + } + + for role_name, color in badge_roles.items(): + app.add_role(name=role_name, role=BadgeRole(color=color))