diff --git a/otc_metadata/templates/index_sbv.rst.j2 b/otc_metadata/templates/index_sbv.rst.j2 new file mode 100644 index 00000000..1ac62966 --- /dev/null +++ b/otc_metadata/templates/index_sbv.rst.j2 @@ -0,0 +1,7 @@ +{{ sbv_title }} + +.. directive_wrapper:: + :class: container-sbv + + .. service_card:: + :service_type: {{ service_type }} \ No newline at end of file diff --git a/tools/generate_doc_confpy.py b/tools/generate_doc_confpy.py index c3de76d3..bf0e53e8 100644 --- a/tools/generate_doc_confpy.py +++ b/tools/generate_doc_confpy.py @@ -48,8 +48,10 @@ def process_repositories(args, service): env = Environment( loader=PackageLoader("otc_metadata"), autoescape=select_autoescape() ) + print(env.list_templates()) conf_py_template = env.get_template("conf.py.j2") tox_ini_template = env.get_template("tox.ini.j2") + index_sbv_template = env.get_template("index_sbv.rst.j2") doc_requirements_template = env.get_template("doc_requirements.txt.j2") for repo in service["repositories"]: @@ -162,6 +164,7 @@ def process_repositories(args, service): project=service["service_title"], # pdf_name=doc["pdf_name"], title=f"{service['service_title']} - Service Based View", + service_type=service["service_type"] ) copy_path = pathlib.Path(copy_to, 'doc', 'source') if not copy_path.exists(): @@ -178,13 +181,22 @@ def process_repositories(args, service): site_name="Internal Documentation Portal", logo_url="https://docs-int.otc-service.com", ) + sbv_title = (service["service_title"] + "\n" + ('=' * len(service["service_title"]))) + content["sbv_title"] = sbv_title conf_py_content = conf_py_template.render(**context) + index_sbv_content = index_sbv_template.render(**content) with open( pathlib.Path(copy_path, "conf.py"), "w", encoding="utf-8") as out: out.write(conf_py_content) + with open( + pathlib.Path(copy_path, "index.rst"), + "w", + encoding="utf-8") as out: + out.write(index_sbv_content) repo_to.index.add(pathlib.Path(copy_path, "conf.py")) + repo_to.index.add(pathlib.Path(copy_path, "index.rst")) if args.update_tox: context = dict(docs=[])