Feature Description
At the moment, Powerpoint templates are very barebones - Ghostwriter simply appends a set of hardcoded slides with hardcoded content to the template. It requires manual post-processing to fill out additional data - for example, the hardcoded "Methodology" slide simply sets the slide title and requires the content to be filled out afterwards.
I believe there's a lot of improvement we can do to makes the PPTX templates more flexible and less hardcoded - see the Implementation Suggestions section for ideas.
Are you intending to implement this feature?
Yes
Current Behavior
PPTX templating is limited to appending slides with hardcoded content.
Desired Behavior
PPTX templates should be able to be more flexible, specifying placeholders for values, etc, like we support with DOCX templates and rich text in general.
Use Case
More flexible templates would allow Ghostwriter to handle more of the generation work and require less work for users.
Implementation Suggestions
- Iterate over each text box in each slide, and apply simple Jinja
{{ var }} substitutions.
- Add in support for jinja tag prefixes (like
{%p ... %}, {%li ... %} to allow dynamic bullet points and tables within text boxes. We have code that does this for html rich text fields that should be translatable to pptx: see html_rich_text.py
- Find a slide field that we can repurpose as a way to tell GW to omit or repeat a slide, emulating an
if/for statement around the entire slide. For example, if the slide notes section starts with the line !FOR finding in findings, we can parse that, evaluate the iterable on the right hand side with jinja, and replace the slide with zero or more copies, templating each with an additional variable in the context. We currently do something similar for client logos.
1 should be low hanging fruit, and would take care of the tedious aspects of replacing client and project names, etc. 2 would take more work but would be a good addition, allowing tables and bullets to be dynamically added. 3 would be more work but, if successful, would get rid of the need for hardcoded slides in general.
One feature that I do not think we should implement is the ability to dynamically add or move top-level elements like text boxes or images. It would be complicated to specify placeholders, and it's also not very useful to support.
Additional Information
Feature Description
At the moment, Powerpoint templates are very barebones - Ghostwriter simply appends a set of hardcoded slides with hardcoded content to the template. It requires manual post-processing to fill out additional data - for example, the hardcoded "Methodology" slide simply sets the slide title and requires the content to be filled out afterwards.
I believe there's a lot of improvement we can do to makes the PPTX templates more flexible and less hardcoded - see the Implementation Suggestions section for ideas.
Are you intending to implement this feature?
Yes
Current Behavior
PPTX templating is limited to appending slides with hardcoded content.
Desired Behavior
PPTX templates should be able to be more flexible, specifying placeholders for values, etc, like we support with DOCX templates and rich text in general.
Use Case
More flexible templates would allow Ghostwriter to handle more of the generation work and require less work for users.
Implementation Suggestions
{{ var }}substitutions.{%p ... %},{%li ... %}to allow dynamic bullet points and tables within text boxes. We have code that does this for html rich text fields that should be translatable to pptx: seehtml_rich_text.pyif/forstatement around the entire slide. For example, if the slide notes section starts with the line!FOR finding in findings, we can parse that, evaluate the iterable on the right hand side with jinja, and replace the slide with zero or more copies, templating each with an additional variable in the context. We currently do something similar for client logos.1 should be low hanging fruit, and would take care of the tedious aspects of replacing client and project names, etc. 2 would take more work but would be a good addition, allowing tables and bullets to be dynamically added. 3 would be more work but, if successful, would get rid of the need for hardcoded slides in general.
One feature that I do not think we should implement is the ability to dynamically add or move top-level elements like text boxes or images. It would be complicated to specify placeholders, and it's also not very useful to support.
Additional Information