mirror of
https://github.com/openshift/community.okd.git
synced 2026-07-29 10:54:31 +00:00
doc fragments workaround for downstream (#59)
* 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>
This commit is contained in:
26
ci/downstream_fragments.py
Executable file
26
ci/downstream_fragments.py
Executable file
@@ -0,0 +1,26 @@
|
||||
#!/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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user