Rootbuzz / shpaml

Load shpaml (haml-like html alternative) templates in django seamlessly. Should work fine extending normal HTML templates and being extended by them.
http://shpaml.com
BSD 3-Clause "New" or "Revised" License
46 stars 9 forks source link

Add option to automatically use `foo.shpaml` when template looks for non-existing `foo.html` #11

Closed cool-RR closed 10 years ago

cool-RR commented 10 years ago

This'll be super userful when dealing with packages like django.contrib.auth that already defined their template names which can't be changed to .shpaml

cool-RR commented 10 years ago

What do you think?

cool-RR commented 10 years ago

Still waiting on a response on this one.

jiaaro commented 10 years ago

Not sure why my reply didn't make it through, but here's the broad strokes: I think this approach is getting away from "explicit is better than implicit" in a way that makes code using shpaml more difficult to maintain.

If you're going to use a *.html file name and you want it to be processed by the shpaml pre-processor, I can think of a few options which seem clearer and more maintainable:

on the other hand you can always do it like this:

auth/index.html (original source)

{% extends "auth/index.shpaml" %}

then you create auth/index.shpaml which extends the template that the original auth/index.html extended:

% extends "admin/base_site.html"

…template code here...
cool-RR commented 10 years ago

Ah, the extends solution looks ideal to me. Thanks!