New template and options for Service-Based-View #61

Merged
zuul merged 15 commits from template_sbv into main 2023-04-20 13:10:19 +00:00
2 changed files with 41 additions and 1 deletions
Showing only changes of commit c597690ecd - Show all commits

View File

@ -17,8 +17,12 @@
import os
import sys
extensions = [
'otcdocstheme'
'otcdocstheme',
{%- if otc_sbv %}
'otc_sphinx_directives'
{%- endif %}
]
otcdocs_auto_name = False

View File

@ -164,10 +164,9 @@ def process_repositories(args, service):
title=f"{service['service_title']} - Service Based View",
)
copy_path = pathlib.Path(copy_to, 'doc', 'source')
print(copy_path)
if not copy_path.exists():
logging.info("Path for sbv does not exist")
copy_path.parent.mkdir(parents=True, exist_ok=True)
copy_path.mkdir(parents=True, exist_ok=True)
context["otc_sbv"] = True
if git_fqdn:
context["git_fqdn"] = git_fqdn
@ -180,8 +179,12 @@ def process_repositories(args, service):
logo_url="https://docs-int.otc-service.com",
)
conf_py_content = conf_py_template.render(**context)
with open(pathlib.Path(copy_path, "conf.py"), "w", encoding="utf-8") as out:
with open(
pathlib.Path(copy_path, "conf.py"),
"w",
encoding="utf-8") as out:
out.write(conf_py_content)
repo_to.index.add(pathlib.Path(copy_path, "conf.py"))
if args.update_tox:
context = dict(docs=[])
@ -294,8 +297,8 @@ def main():
parser.add_argument("--token", metavar="token", help="API token")
parser.add_argument("--api-url", help="API base url of the Git hoster")
parser.add_argument(
"--update_sbv",
action="store_true",
"--update-sbv",
action="store_true",
help="Whether to update service-based-view"
)