Skip to content

Commit 6e5b0ff

Browse files
committed
Add support for pptx output file generation
This commit adds a task to the mai playbook to use marp tool with the --pptx option to generate PowerPoint compatible files.
1 parent db02315 commit 6e5b0ff

File tree

4 files changed

+29
-5
lines changed

4 files changed

+29
-5
lines changed

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ pandoc_agenda_output_pdf: "{{ kpa_project_dir }}/slides.agenda.pdf"
4949
# Marp Markdown output files destination
5050
marp_output_markdown: "{{ kpa_project_dir }}/slides.md"
5151
marp_output_pdf: "{{ kpa_project_dir }}/slides.pdf"
52+
# Set marp_output_pptx to generate a PowerPoint compatible file
53+
# marp_output_pptx: "{{ kpa_project_dir }}/slides.pptx"
5254

5355
# Marp theme (default, gaia, uncover or a custom theme)
5456
marp_theme: default
@@ -95,6 +97,10 @@ kpa_slides:
9597
content: "{{ kpa_project_dir }}/contents/knowledge-pod-2.md"
9698
```
9799
100+
For example, to generate a `pptx` output file just set the `marp_output_pptx`
101+
variable, and the playbook will also run marp with the option to generate a
102+
Microsoft PowerPoint compatible file.
103+
98104
Example Playbook
99105
----------------
100106

@@ -117,7 +123,7 @@ And execute it using `ansible-playbook`:
117123

118124
```console
119125
> ansible-playbook tests/kpa_generator.yml
120-
PLAY [Use a KPA Project to create Marp & Pandoc markdown fils and their pdf] ***
126+
PLAY [Use a KPA Project to create Marp & Pandoc markdown and slide decks] ******
121127
122128
TASK [../.. : Create Marp slides markdown] *************************************
123129
changed: [localhost]
@@ -128,11 +134,14 @@ changed: [localhost]
128134
TASK [../.. : Generate pdf slides with Marp] ***********************************
129135
changed: [localhost]
130136
137+
TASK [../.. : Generate pptx slides with Marp] **********************************
138+
skipping: [localhost]
139+
131140
TASK [../.. : Generate pdf agenda with Pandoc] *********************************
132141
changed: [localhost]
133142
134143
PLAY RECAP *********************************************************************
135-
localhost : ok=4 changed=4 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0
144+
localhost : ok=4 changed=4 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0
136145
```
137146

138147
This will generate two couples of files:

defaults/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ pandoc_agenda_output_pdf: "{{ kpa_project_dir }}/slides.agenda.pdf"
2929
# Marp Markdown output file destination
3030
marp_output_markdown: "{{ kpa_project_dir }}/slides.md"
3131
marp_output_pdf: "{{ kpa_project_dir }}/slides.pdf"
32+
# Set marp_output_pptx to generate a PowerPoint compatible file
33+
# marp_output_pptx: "{{ kpa_project_dir }}/slides.pptx"
3234

3335
# Marp theme (default, gaia, uncover or a custom theme)
3436
marp_theme: default

tasks/main.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,21 @@
2222
{{ marp_output_markdown }}
2323
when:
2424
- marp_output_pdf is defined
25-
register: marp_cmd
26-
changed_when: marp_cmd.rc == 0
25+
register: marp_pdf_cmd
26+
changed_when: marp_pdf_cmd.rc == 0
27+
28+
- name: Generate pptx slides with Marp
29+
ansible.builtin.shell: |
30+
marp --pptx \
31+
--allow-local-files \
32+
--html \
33+
{% if marp_theme_file is defined %}--theme {{ marp_theme_file }}{% endif %} \
34+
-o {{ marp_output_pptx }} \
35+
{{ marp_output_markdown }}
36+
when:
37+
- marp_output_pptx is defined
38+
register: marp_pptx_cmd
39+
changed_when: marp_pptx_cmd.rc == 0
2740

2841
- name: Generate pdf agenda with Pandoc
2942
ansible.builtin.shell: |

tests/kpa_generator.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
- hosts: localhost
44
gather_facts: false
55
connection: local
6-
name: Use a KPA Project to create Marp & Pandoc markdown fils and their pdf
6+
name: Use a KPA Project to create Marp & Pandoc markdown and slide decks
77
roles:
88
- role: ../..

0 commit comments

Comments
 (0)