Skip to content

Improve filtering/buffering documentation. #239

Open
@sqlalchemy-bot

Description

@sqlalchemy-bot

Migrated issue, originally created by Cody Taylor (@CodeMan99)

The default_filters argument to a TemplateLookup could use some deeper explaining.

When I added a default HTML filter at work today there was some confusion as to why the template rendered as normal. It required about a hour of thinking and code examples before the light bulb went off. Perhaps we both were being dense, but here are my suggestions.

  1. Mention in syntax that writing is separate from filtering (unless captured).
  2. Explain default_filters before <%page expression_filters="n" />.
  3. Explain that <%page expression_filters="h" /> will append to any existing default_filters list.
  4. (Maybe) state in API documention that default_filters does not apply to <%block> <%def> and <%page>'s unbuffered writes.
  5. Provide an example of a <%def> that does not buffer in the buffering section. In particular state that the buffered example does return buf.getvalue() instead of return ''.

Relates to #111.

As always willing to implement upon agreement.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions