diff --git a/otc_doc_convertor/convertor.py b/otc_doc_convertor/convertor.py index 67d47c685..7981a212d 100644 --- a/otc_doc_convertor/convertor.py +++ b/otc_doc_convertor/convertor.py @@ -264,6 +264,11 @@ class OTCDocConvertor: logging.warning( f"CLASS.TXT.json file is missing in {self.args.path}, " f"assuming initial import") + with open(pathlib.Path(dest, "index.rst"), "w") as index: + index.write('=' * (len(self.args.title)) + '\n') + index.write(self.args.title + '\n') + index.write('=' * (len(self.args.title)) + '\n') + index.write('\n') sys.exit(0) meta_data = json.loads(open(metadata_file).read()) metadata_by_uri = dict() diff --git a/playbooks/post.yaml b/playbooks/post.yaml index 9f51b8230..fc9c58ef3 100644 --- a/playbooks/post.yaml +++ b/playbooks/post.yaml @@ -10,8 +10,8 @@ vars: fetch_doc_artifacts_name: "{{ doc.label }}" fetch_doc_artifacts_rst_source: "{{ ansible_user_dir }}/{{ docs_rst_location }}/{{ doc.label }}/{{ docs_new_location }}" - fetch_doc_artifacts_diff_patch: "{{ ansible_user_dir }}/{{ doc.label }}.patch" - fetch_doc_artifacts_git_patch: "{{ ansible_user_dir }}/{{ doc.label }}.git.patch" + # fetch_doc_artifacts_diff_patch: "{{ ansible_user_dir }}/{{ doc.label }}.patch" + # fetch_doc_artifacts_git_patch: "{{ ansible_user_dir }}/{{ doc.label }}.git.patch" loop: "{{ docs }}" loop_control: loop_var: "doc" diff --git a/playbooks/run.yaml b/playbooks/run.yaml index d08caaa78..8085afdbe 100644 --- a/playbooks/run.yaml +++ b/playbooks/run.yaml @@ -35,38 +35,38 @@ label: "{{ doc.label }}" when: "git_log.stdout is search(doc.html_location) or git_log.stdout is search('otc_doc_convertor') or git_log.stdout is search('playbooks')" - - name: Restore to the previous git state - command: "git checkout HEAD^1" - args: - chdir: "{{ zuul.project.src_dir }}" - - - name: Generate base RSTs - include_role: - name: "convert_doc" - vars: - doc_label: "{{ doc.label }}" - dest: "{{ ansible_user_dir }}/{{ docs_rst_location }}/{{ doc.label }}/{{ docs_base_location }}" - source: "{{ zuul.project.src_dir }}/{{ doc.html_location }}" - loop: "{{ docs }}" - loop_control: - loop_var: "doc" - label: "{{ doc.label }}" - when: "git_log.stdout is search(doc.html_location) or git_log.stdout is search('otc_doc_convertor')" - - - name: Generate patch file - include_role: - name: "generate_doc_patch" - vars: - doc_label: "{{ doc.label }}" - generate_doc_patch_base_location: "{{ docs_base_location }}" - generate_doc_patch_new_location: "{{ docs_new_location }}" - generate_doc_patch_repository: "{{ doc.repository }}" - generate_doc_patch_project_location: "{{ doc.project_location }}" - generate_doc_patch_base: "{{ ansible_user_dir }}/{{ docs_rst_location }}/{{ doc.label }}" - generate_doc_patch_diff_patch_location: "{{ ansible_user_dir }}/{{ doc.label }}.patch" - generate_doc_patch_git_patch_location: "{{ ansible_user_dir }}/{{ doc.label }}.git.patch" - loop: "{{ docs }}" - loop_control: - loop_var: "doc" - label: "{{ doc.label }}" - when: "git_log.stdout is search(doc.html_location) or git_log.stdout is search('otc_doc_convertor')" + # - name: Restore to the previous git state + # command: "git checkout HEAD^1" + # args: + # chdir: "{{ zuul.project.src_dir }}" + # + # - name: Generate base RSTs + # include_role: + # name: "convert_doc" + # vars: + # doc_label: "{{ doc.label }}" + # dest: "{{ ansible_user_dir }}/{{ docs_rst_location }}/{{ doc.label }}/{{ docs_base_location }}" + # source: "{{ zuul.project.src_dir }}/{{ doc.html_location }}" + # loop: "{{ docs }}" + # loop_control: + # loop_var: "doc" + # label: "{{ doc.label }}" + # when: "git_log.stdout is search(doc.html_location) or git_log.stdout is search('otc_doc_convertor')" + # + # - name: Generate patch file + # include_role: + # name: "generate_doc_patch" + # vars: + # doc_label: "{{ doc.label }}" + # generate_doc_patch_base_location: "{{ docs_base_location }}" + # generate_doc_patch_new_location: "{{ docs_new_location }}" + # generate_doc_patch_repository: "{{ doc.repository }}" + # generate_doc_patch_project_location: "{{ doc.project_location }}" + # generate_doc_patch_base: "{{ ansible_user_dir }}/{{ docs_rst_location }}/{{ doc.label }}" + # generate_doc_patch_diff_patch_location: "{{ ansible_user_dir }}/{{ doc.label }}.patch" + # generate_doc_patch_git_patch_location: "{{ ansible_user_dir }}/{{ doc.label }}.git.patch" + # loop: "{{ docs }}" + # loop_control: + # loop_var: "doc" + # label: "{{ doc.label }}" + # when: "git_log.stdout is search(doc.html_location) or git_log.stdout is search('otc_doc_convertor')"