This is definitely better than what I had before, and it seems to work
fairly well. Thank you! But I have two follow-up questions:

1) Is there any way to define a footnote using tags instead? It seems
that this would involve much more work, but given that I'll be calling
several filters in each of my footnotes, I'd like to have the
convenience of using something like the Django version I described
earlier.

2) When you say this can be "wrapped in an object," what sort of
object do you mean? Do you mean an Extension, or something else? I'm
still a bit of a Jinja2 novice, so I'm not sure how to proceed here.

Thanks again.

On Mar 16, 6:43 am, Simon Sapin <[email protected]> wrote:
> Le 16/03/2012 08:47, AKP a crit :
>
> >      ... foo foo {% footnote %}This is a footnote{% endfootnote %} foo
> > foo ...
> >      ... bar bar {% footnote %}This is another footnote{% endfootnote
> > %} bar bar ...
> >      ...
> >      ...
> >      {% all_footnotes %}
>
> Hi,
>
> A "low-tech" solution (unested):
>
> {% set notes = [] %}
> foo foo {{ notes.append('footnote text') or '[%d]' % len(notes) }}
>
> ...
> {% for i, text in enumerate(notes, 1) %}
> {{ '[%d] %s' % (i, text) }}
> {% endfor %}
>
> If this works, it can be wrapped in an object with nice methods and all
> that.
>
> Regards,
> --
> Simon Sapin

-- 
You received this message because you are subscribed to the Google Groups 
"pocoo-libs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pocoo-libs?hl=en.

Reply via email to