mirror of
https://github.com/openshift/community.okd.git
synced 2026-05-06 13:12:37 +00:00
* doc fragments workaround for downstream Signed-off-by: Adam Miller <admiller@redhat.com> * make shellcheck happy Signed-off-by: Adam Miller <admiller@redhat.com> * fix collection location for downstream doc fragment resolution Signed-off-by: Adam Miller <admiller@redhat.com> * do things in the correct order Signed-off-by: Adam Miller <admiller@redhat.com> * add ANSIBLE_COLLECTIONS_PATH to ansible-doc for downstream Signed-off-by: Adam Miller <admiller@redhat.com> * remove elements of the json dump that aren't valid for DOCUMENTATION Signed-off-by: Adam Miller <admiller@redhat.com> * Add fix for Ansible 2.9 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com> * Update ci/downstream.sh Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com> Co-authored-by: Jeff Geerling <geerlingguy@mac.com>
27 lines
762 B
Python
Executable File
27 lines
762 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
import json
|
|
import yaml
|
|
import sys
|
|
|
|
with open("./rendereddocfragments.txt", 'w') as df_fd:
|
|
with open(sys.argv[2], 'r') as fd:
|
|
json_docs = json.load(fd)
|
|
|
|
json_docs[sys.argv[1]]['doc'].pop('collection', '')
|
|
json_docs[sys.argv[1]]['doc'].pop('filename', '')
|
|
|
|
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("EXAMPLES = '''\n")
|
|
df_fd.write(json_docs[sys.argv[1]]['examples'])
|
|
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")
|
|
|
|
|