diff --git a/doc/source/examples/directives_bd.rst b/doc/source/examples/directives_bd.rst new file mode 100644 index 0000000..cf40d27 --- /dev/null +++ b/doc/source/examples/directives_bd.rst @@ -0,0 +1,9 @@ +Business Dashboard +================== + + +.. directive_wrapper:: + :class: container-sbv + + .. service_card:: + :service_type: bd diff --git a/doc/source/examples/directives_geminidb_internal.rst b/doc/source/examples/directives_geminidb_internal.rst new file mode 100644 index 0000000..a66b274 --- /dev/null +++ b/doc/source/examples/directives_geminidb_internal.rst @@ -0,0 +1,13 @@ +GeminiDB - Internal +=================== + +.. directive_wrapper:: + :class: container-sbv + :id: test2 + + .. service_card:: + :environment: internal + :service_type: geminidb + :umn: This document describes basic concepts, functions, key terms, and FAQs of ECSs and provides instructions for applying for and using ECSs. + :api-ref: This document describes application programming interfaces (APIs) of Elastic Cloud Server (ECS) and provides API parameter description and example values. + :dev: This document describes how to call the APIs of Elastic Cloud Server (ECS) to use ECS functions. diff --git a/doc/source/examples/index.rst b/doc/source/examples/index.rst index 4827710..d5b41f7 100644 --- a/doc/source/examples/index.rst +++ b/doc/source/examples/index.rst @@ -7,6 +7,8 @@ Documentation Examples directives_obs_clean directives_ecs directives_ecs_internal + directives_bd + directives_geminidb_internal directives_docsportal container_item card_item diff --git a/otc_sphinx_directives/service_card.py b/otc_sphinx_directives/service_card.py index 6ae57bd..69686c2 100644 --- a/otc_sphinx_directives/service_card.py +++ b/otc_sphinx_directives/service_card.py @@ -102,6 +102,7 @@ def service_card_html(self, node): docs = sort_docs(service['documents']) for doc in docs: + environment = doc.get('environment') if environment == "hidden": continue @@ -113,7 +114,7 @@ def service_card_html(self, node): else: link = doc['link'] - data = '
' + data = '
' data += (f'') data += ( '
' @@ -126,8 +127,22 @@ def service_card_html(self, node): data += ( f'

{node[doc["type"]]}

' ) - data += '
' + data += '
' + try: + if doc["pdf_enabled"]: + data += (f''' + + + Download PDF + + ''') + except Exception: + print("Service " + node['service_type'] + " has not defined pdf_enabled!") + + data += '' + self.body.append(data) + raise nodes.SkipNode