Create doc-exports metadata generator script
- add script to generate metadata file for doc-exports repository - fix metadata issues which became visible with that script
This commit is contained in:
@ -95,3 +95,37 @@ class Services(object):
|
||||
res_doc["repository"] = srv_env["repo"]
|
||||
res.append(res_doc)
|
||||
return res
|
||||
|
||||
def docs_html_by_category(self, environment):
|
||||
"""Generate structure for doc-exports repository
|
||||
|
||||
"""
|
||||
doc_struct = dict()
|
||||
services = self.service_dict
|
||||
for srv in self.all_services:
|
||||
doc_struct.setdefault(srv["service_category"], [])
|
||||
srv_res = dict(
|
||||
service_title=srv['service_title'],
|
||||
service_type=srv['service_type'],
|
||||
docs=[]
|
||||
)
|
||||
if "repositories" in srv and environment:
|
||||
for repo in srv["repositories"]:
|
||||
if "environment" in repo and repo["environment"] == environment:
|
||||
srv_res["repository"] = repo["repo"]
|
||||
for doc in self.all_docs:
|
||||
if (
|
||||
"html_location" in doc
|
||||
and doc["service_type"] == srv_res["service_type"]
|
||||
):
|
||||
doc_res = dict(
|
||||
html_location=doc["html_location"],
|
||||
rst_location=doc["rst_location"],
|
||||
title=doc["title"],
|
||||
pdf_name=doc["pdf_name"]
|
||||
)
|
||||
srv_res["docs"].append(doc_res)
|
||||
if len(srv_res["docs"]) > 0:
|
||||
doc_struct[srv["service_category"]].append(srv_res)
|
||||
|
||||
return dict(categories=doc_struct)
|
||||
|
Reference in New Issue
Block a user