add step to prepare downstream collection (#154)

* add step to prepare downstream collection

* fix header generation

* update downstream_fragments.py
This commit is contained in:
Bikouo Aubin
2022-04-29 15:22:46 +02:00
committed by GitHub
parent 0290391446
commit b2d9e78b8e
10 changed files with 140 additions and 25 deletions

View File

@@ -15,14 +15,18 @@ with open("./rendereddocfragments.txt", 'w') as df_fd:
json_docs[sys.argv[1]]['doc'].pop('filename', '')
json_docs[sys.argv[1]]['doc'].pop('has_action', '')
df_fd.write("DOCUMENTATION = '''\n")
df_fd.write('DOCUMENTATION = """\n')
df_fd.write(yaml.dump(json_docs[sys.argv[1]]['doc'], default_flow_style=False))
df_fd.write("'''\n\n")
df_fd.write('"""\n\n')
df_fd.write("EXAMPLES = '''\n")
df_fd.write('EXAMPLES = """')
df_fd.write(json_docs[sys.argv[1]]['examples'])
df_fd.write("'''\n\n")
df_fd.write('"""\n\n')
df_fd.write("RETURN = '''\n")
df_fd.write(yaml.dump(json_docs[sys.argv[1]]['return'], default_flow_style=False))
df_fd.write("'''\n\n")
df_fd.write('RETURN = r"""')
data = json_docs[sys.argv[1]]['return']
if isinstance(data, dict):
df_fd.write(yaml.dump(data, default_flow_style=False))
else:
df_fd.write(data)
df_fd.write('"""\n\n')