From fc829504377f2668714b8b8e5aca494df1485aba Mon Sep 17 00:00:00 2001 From: Bartosz Gentkowski Date: Wed, 20 Sep 2023 16:07:19 +0200 Subject: [PATCH] doc: add Zoomin info banner to doc Add a banner on top informing about the transition to the Zoomin documentation platform. Signed-off-by: Bartosz Gentkowski --- doc/_utils/utils.py | 15 +++++++++++++++ doc/kconfig/conf.py | 1 + doc/matter/conf.py | 1 + doc/mcuboot/conf.py | 1 + doc/nrf/conf.py | 1 + doc/nrfx/conf.py | 1 + doc/nrfxlib/conf.py | 1 + doc/tfm/conf.py | 1 + doc/zephyr/conf.py | 1 + 9 files changed, 23 insertions(+) diff --git a/doc/_utils/utils.py b/doc/_utils/utils.py index d91b309ae764..4fe7c7eb2088 100644 --- a/doc/_utils/utils.py +++ b/doc/_utils/utils.py @@ -128,3 +128,18 @@ def add_google_analytics(app: Sphinx, options: dict) -> None: options["add_gtm"] = True options["gtm_id"] = "GTM-WF4CVFX" + +def add_announcement_banner(options: dict) -> None: + """Add an announcement banner to the top of the page. + Args: + options: html theme options. + """ + + msg = "Important: We're excited to introduce our new technical documentation " \ + "platform docs.nordicsemi.com, " \ + "currently in Beta version. We invite you to explore it and share your feedback. " \ + "Read more on our " \ + "DevZone blog. " \ + + options["set_default_announcement"] = True + options["default_announcement_message"] = msg diff --git a/doc/kconfig/conf.py b/doc/kconfig/conf.py index e69b9edb7d95..896461156390 100644 --- a/doc/kconfig/conf.py +++ b/doc/kconfig/conf.py @@ -72,3 +72,4 @@ def setup(app): app.add_css_file("css/kconfig.css") utils.add_google_analytics(app, html_theme_options) + utils.add_announcement_banner(html_theme_options) diff --git a/doc/matter/conf.py b/doc/matter/conf.py index 8186404ed1a2..dc226c2236c5 100644 --- a/doc/matter/conf.py +++ b/doc/matter/conf.py @@ -71,3 +71,4 @@ def setup(app): app.add_css_file("css/matter.css") utils.add_google_analytics(app, html_theme_options) + utils.add_announcement_banner(html_theme_options) diff --git a/doc/mcuboot/conf.py b/doc/mcuboot/conf.py index 2f306aec1728..138cc466f6b8 100644 --- a/doc/mcuboot/conf.py +++ b/doc/mcuboot/conf.py @@ -90,3 +90,4 @@ def setup(app): utils.add_google_analytics(app, html_theme_options) + utils.add_announcement_banner(html_theme_options) diff --git a/doc/nrf/conf.py b/doc/nrf/conf.py index 65468f900cd5..b95e329078e6 100644 --- a/doc/nrf/conf.py +++ b/doc/nrf/conf.py @@ -226,3 +226,4 @@ def setup(app): app.add_css_file("css/nrf.css") utils.add_google_analytics(app, html_theme_options) + utils.add_announcement_banner(html_theme_options) diff --git a/doc/nrfx/conf.py b/doc/nrfx/conf.py index ebd22c058a87..a32833fb2e1a 100644 --- a/doc/nrfx/conf.py +++ b/doc/nrfx/conf.py @@ -70,3 +70,4 @@ def setup(app): utils.add_google_analytics(app, html_theme_options) + utils.add_announcement_banner(html_theme_options) diff --git a/doc/nrfxlib/conf.py b/doc/nrfxlib/conf.py index 38f84250e01c..1ade6460fd08 100644 --- a/doc/nrfxlib/conf.py +++ b/doc/nrfxlib/conf.py @@ -106,3 +106,4 @@ def setup(app): app.add_css_file("css/nrfxlib.css") utils.add_google_analytics(app, html_theme_options) + utils.add_announcement_banner(html_theme_options) diff --git a/doc/tfm/conf.py b/doc/tfm/conf.py index 09a175603dcc..78b2f17a727a 100644 --- a/doc/tfm/conf.py +++ b/doc/tfm/conf.py @@ -81,3 +81,4 @@ def setup(app): app.add_css_file("css/tfm.css") utils.add_google_analytics(app, html_theme_options) + utils.add_announcement_banner(html_theme_options) diff --git a/doc/zephyr/conf.py b/doc/zephyr/conf.py index 9bd73690cc71..1aaa8fa668e9 100644 --- a/doc/zephyr/conf.py +++ b/doc/zephyr/conf.py @@ -82,3 +82,4 @@ def setup(app): app.add_css_file("css/zephyr.css") utils.add_google_analytics(app, html_theme_options) + utils.add_announcement_banner(html_theme_options)