Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Improvement] use Jinja2 templating scheme #24

Open
moutonjr opened this issue May 30, 2018 · 2 comments
Open

[Improvement] use Jinja2 templating scheme #24

moutonjr opened this issue May 30, 2018 · 2 comments

Comments

@moutonjr
Copy link

Hi, thank you for your work, this is indeed VERY helpful.

This could be great to turn tempalting scheme into Jinja2 one (http://jinja.pocoo.org/docs/2.10/)

The best feature could be case control and iteration with Jinja, just like (in a PPTX file) :


----
Here are the list of to-dos : 

{% for entry in hello.entries %}
-  TODO: {{entry}}
{%endfor%}
@skar404
Copy link
Contributor

skar404 commented May 30, 2018

@moutonjr I don't know, but I think it's easier to do it at the Python level,

let's say so:

pptx.app(slide(
   template='template_name',  # Slide id
   data={
       'hello': { 
           'entries': [1, 2, 3, 4]   
       }
   }
))

.pptx is not html :(

@Thykof
Copy link

Thykof commented Jun 19, 2020

For Jinja2 template scheme, see https://github.com/kwlo/python-pptx-templater.

@skar404 Doing this at a Python level will not create the desired number or row in a table. I don't think that pptx-template will generate as many rows as you specified in the entries list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants