Skip to content

Added section on Chameleon templating, for Issue #382#501

Merged
sigmavirus24 merged 5 commits into
realpython:masterfrom
webmaven:master
Dec 7, 2014
Merged

Added section on Chameleon templating, for Issue #382#501
sigmavirus24 merged 5 commits into
realpython:masterfrom
webmaven:master

Conversation

@webmaven

@webmaven webmaven commented Dec 2, 2014

Copy link
Copy Markdown
Contributor

Added section on Chameleon templating, for Issue #382.

@sigmavirus24

Copy link
Copy Markdown
Contributor

So I have mixed feelings about this. By far the three most popular templating libraries are:

  • Jinja2
  • The one included in Django whose name I'm forgetting
  • Mako

I've never heard of Chameleon and judging by its GitHub repo (which I very well know is a bad indicator, especially if it has only just moved to GitHub) it isn't that popular. Looking at its download count on PyPI, it's seems to have the benefit of a lot of releases and only recently has it become moderately popular.

The guide also doesn't aim to include every project because Warehouse takes care of that very well. What's disappointing to me is that we don't discuss Mako at all in the guide, especially since it is so very popular.

The guide also shouldn't just be a collection of the most popular frameworks for something. It should highlight the best and help users differentiate the projects/frameworks from other items in the guide (so they can better make a decision without having to spend weeks testing and experimenting with each).

With all of this said, it's not something I want to reject, but I would also rather its description not be entirely copied from the docs in bits and pieces. This should describe the difference from Jinja2 (which is also very fast) and it should not simply say "if you're already familiar with {{ zope-ism}} then" because I would expect not many people to be as familiar with it as you are (or another zopatista would be).

So yes I will merge this, but not in its current state.

@webmaven

webmaven commented Dec 2, 2014

Copy link
Copy Markdown
Contributor Author

OK, I will improve it. It may help to know that the Template Attribute Language (of which Chameleon is an implementation) is far more widespread than it may seem: http://en.wikipedia.org/wiki/Template_Attribute_Language

Chameleon is used quite a bit in Pyramid projects.

@sigmavirus24

Copy link
Copy Markdown
Contributor

@webmaven ping me when you've updated this.

@webmaven

webmaven commented Dec 7, 2014

Copy link
Copy Markdown
Contributor Author

@mcdonc, do you have feedback?

@sigmavirus24

Copy link
Copy Markdown
Contributor

@webmaven this is exactly what I was thinking of when I asked for some more detail. I'll wait for @mcdonc to respond to your request for feedback before merging.

I really appreciate your effort @webmaven this is fantastic

@mcdonc

mcdonc commented Dec 7, 2014

Copy link
Copy Markdown

I have no feedback, I'm not really super-interested in templating languages, sorry.

@sigmavirus24

Copy link
Copy Markdown
Contributor

No need to apologize @mcdonc. Thanks for visiting anyway.

sigmavirus24 added a commit that referenced this pull request Dec 7, 2014
Added section on Chameleon templating, for Issue #382
@sigmavirus24 sigmavirus24 merged commit 975a7e6 into realpython:master Dec 7, 2014
@sigmavirus24

Copy link
Copy Markdown
Contributor

✨ 🍰 ✨ for @webmaven

@webmaven

webmaven commented Dec 7, 2014

Copy link
Copy Markdown
Contributor Author

@mcdonc, oops, looks like I should have asked @malthe instead.

@sigmavirus24, thanks for the sparkly cake!

@malthe

malthe commented Dec 8, 2014

Copy link
Copy Markdown

Yo @sigmavirus24 – Chameleon author here. I really don't know how popular or unpopular Chameleon is, but it's a mature project that has a lot of features such as good internationalization support and pretty advanced macro usage patterns. That said, people seem to prefer the non-XHTML languages such as Jinja2 and Mako, although I never really understood why. I think "safe by default" is better than safe if you remember it – a la <expression> | safe (i.e. HTML escape).

@webmaven

Copy link
Copy Markdown
Contributor Author

I can try expanding the section further to include those additional points of difference.

@sigmavirus24

Copy link
Copy Markdown
Contributor

So this is the balancing act I have to do with the guide: Point out really good libraries and/or point out things that people will likely find themselves using when the collaborate with others. In that sense I've only ever seen projects use Jinja2 and Mako, but I've never worked on a Pyramid project (where I suspect Chameleon would be the standard). It's tough for me because I can't be a member of every sub-community of the larger Python community so I tend to be skeptical at first. If it's something that looks solid I'll probably accept it but I really want this guide to be more than just a short description of each tool. I want it to compare each tool so someone knows why they might want to use Mako over Jinja2 or Pyramid over Django. Make sense? I think in this sense, the guide needs a bit of an overhaul, but I don't have the time for that. =)

@webmaven

Copy link
Copy Markdown
Contributor Author

Hmm. Well, I'm really not familiar with Jinja2 or Mako, mostly just Chameleon and Django templates (some recent experience with HAML in the RoR world). I should probably wait to see such a comparison before attempting to add my own.

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

Successfully merging this pull request may close these issues.

4 participants