diff --git a/otc_metadata/templates/conf.py.j2 b/otc_metadata/templates/conf.py.j2 index e98e7cd..a09ef1d 100644 --- a/otc_metadata/templates/conf.py.j2 +++ b/otc_metadata/templates/conf.py.j2 @@ -47,7 +47,8 @@ otcdocs_doc_type = '{{ doc_type }}' otcdocs_service_category = '{{ service_category }}' otcdocs_service_title = '{{ service_title }}' otcdocs_service_type = '{{ service_type }}' -otcdocs_search_environment = 'hc_de' +otcdocs_search_environment = '{{ otcdocs_search_environment }}' +otcdocs_search_index = '{{ otcdocs_search_index }}' otcdocs_search_url = "https://opensearch.eco.tsi-dev.otc-service.com/" # If extensions (or modules to document with autodoc) are in another directory, diff --git a/otc_metadata/templates/tox.ini.j2 b/otc_metadata/templates/tox.ini.j2 index 82a1bc5..edfd5f1 100644 --- a/otc_metadata/templates/tox.ini.j2 +++ b/otc_metadata/templates/tox.ini.j2 @@ -64,9 +64,11 @@ commands = wget -O {toxinidir}/_templates/longtable.tex.jinja https://gitea.eco.tsi-dev.otc-service.com/infra/docs-templates/raw/branch/main/templates/longtable.tex.jinja wget -O {toxinidir}/_templates/tabular.tex.jinja https://gitea.eco.tsi-dev.otc-service.com/infra/docs-templates/raw/branch/main/templates/tabular.tex.jinja wget -O {toxinidir}/_templates/tabulary.tex.jinja https://gitea.eco.tsi-dev.otc-service.com/infra/docs-templates/raw/branch/main/templates/tabulary.tex.jinja +{%- for doc in docs %} {%- if doc.pdf_enabled %} {[testenv:{{ doc.type }}-pdf-docs]commands} {%- endif %} +{%- endfor %} {% endif %} {% for doc in docs -%} diff --git a/tools/generate_doc_confpy.py b/tools/generate_doc_confpy.py index 0457cd2..a7f5d31 100644 --- a/tools/generate_doc_confpy.py +++ b/tools/generate_doc_confpy.py @@ -174,10 +174,14 @@ def process_repositories(args, service): context["html_options"] = dict( logo_url="https://docs.sc.otc.t-systems.com", ) + context["otcdocs_search_environment"] = "hc_swiss" + context["otcdocs_search_index"] = "search_index_swiss" elif (args.target_environment == "public"): context["html_options"] = dict( logo_url="https://docs.otc.t-systems.com", ) + context["otcdocs_search_environment"] = "hc_de" + context["otcdocs_search_index"] = "search_index_de" elif (args.target_environment == "internal" and args.cloud_environment == "swiss"): context["html_options"] = dict( @@ -185,12 +189,16 @@ def process_repositories(args, service): site_name="Internal Documentation Portal", logo_url="https://docs-swiss-int.otc-service.com", ) + context["otcdocs_search_environment"] = "hc_swiss" + context["otcdocs_search_index"] = "search_index_swiss" elif args.target_environment == "internal": context["html_options"] = dict( disable_search=True, site_name="Internal Documentation Portal", logo_url="https://docs-int.otc-service.com", ) + context["otcdocs_search_environment"] = "hc_de" + context["otcdocs_search_index"] = "search_index_de" context["doc_environment"] = args.target_environment if doc['link']: context["doc_link"] = doc['link'] @@ -295,8 +303,8 @@ def process_repositories(args, service): if cloud_environment["name"] == args.cloud_environment: if doc["type"] == "dev": doc["type"] = "dev-guide" + doc["pdf_enabled"] = cloud_environment["pdf_enabled"] context["docs"].append(doc) - context["pdf_enabled"] = cloud_environment["pdf_enabled"] context["target_environment"] = args.target_environment context["service_type"] = service['service_type']