diff --git a/README.md b/README.md index 8ad60fc..14c8fa1 100644 --- a/README.md +++ b/README.md @@ -49,6 +49,8 @@ pandoc_agenda_output_pdf: "{{ kpa_project_dir }}/slides.agenda.pdf" # Marp Markdown output files destination marp_output_markdown: "{{ kpa_project_dir }}/slides.md" marp_output_pdf: "{{ kpa_project_dir }}/slides.pdf" +# Set marp_output_pptx to generate a PowerPoint compatible file +# marp_output_pptx: "{{ kpa_project_dir }}/slides.pptx" # Marp theme (default, gaia, uncover or a custom theme) marp_theme: default @@ -95,6 +97,10 @@ kpa_slides: content: "{{ kpa_project_dir }}/contents/knowledge-pod-2.md" ``` +For example, to generate a `pptx` output file just set the `marp_output_pptx` +variable, and the playbook will also run marp with the option to generate a +Microsoft PowerPoint compatible file. + Example Playbook ---------------- @@ -117,7 +123,7 @@ And execute it using `ansible-playbook`: ```console > ansible-playbook tests/kpa_generator.yml -PLAY [Use a KPA Project to create Marp & Pandoc markdown fils and their pdf] *** +PLAY [Use a KPA Project to create Marp & Pandoc markdown and slide decks] ****** TASK [../.. : Create Marp slides markdown] ************************************* changed: [localhost] @@ -128,11 +134,14 @@ changed: [localhost] TASK [../.. : Generate pdf slides with Marp] *********************************** changed: [localhost] +TASK [../.. : Generate pptx slides with Marp] ********************************** +skipping: [localhost] + TASK [../.. : Generate pdf agenda with Pandoc] ********************************* changed: [localhost] PLAY RECAP ********************************************************************* -localhost : ok=4 changed=4 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 +localhost : ok=4 changed=4 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0 ``` This will generate two couples of files: diff --git a/defaults/main.yml b/defaults/main.yml index f52b2a6..28e31f1 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -29,6 +29,8 @@ pandoc_agenda_output_pdf: "{{ kpa_project_dir }}/slides.agenda.pdf" # Marp Markdown output file destination marp_output_markdown: "{{ kpa_project_dir }}/slides.md" marp_output_pdf: "{{ kpa_project_dir }}/slides.pdf" +# Set marp_output_pptx to generate a PowerPoint compatible file +# marp_output_pptx: "{{ kpa_project_dir }}/slides.pptx" # Marp theme (default, gaia, uncover or a custom theme) marp_theme: default diff --git a/tasks/main.yml b/tasks/main.yml index 9efb7d0..3abfad9 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -22,8 +22,21 @@ {{ marp_output_markdown }} when: - marp_output_pdf is defined - register: marp_cmd - changed_when: marp_cmd.rc == 0 + register: marp_pdf_cmd + changed_when: marp_pdf_cmd.rc == 0 + +- name: Generate pptx slides with Marp + ansible.builtin.shell: | + marp --pptx \ + --allow-local-files \ + --html \ + {% if marp_theme_file is defined %}--theme {{ marp_theme_file }}{% endif %} \ + -o {{ marp_output_pptx }} \ + {{ marp_output_markdown }} + when: + - marp_output_pptx is defined + register: marp_pptx_cmd + changed_when: marp_pptx_cmd.rc == 0 - name: Generate pdf agenda with Pandoc ansible.builtin.shell: | diff --git a/tests/kpa_generator.yml b/tests/kpa_generator.yml index 2e9bfa1..5d090e7 100644 --- a/tests/kpa_generator.yml +++ b/tests/kpa_generator.yml @@ -3,6 +3,6 @@ - hosts: localhost gather_facts: false connection: local - name: Use a KPA Project to create Marp & Pandoc markdown fils and their pdf + name: Use a KPA Project to create Marp & Pandoc markdown and slide decks roles: - role: ../..