How about doctype webdesign helper

27 views
Skip to first unread message

Yaşar Arabacı

unread,
Sep 30, 2011, 6:20:11 PM9/30/11
to django-developers
Hi,

While going through documentation, I saw webdesign helpers, which I didn't know that even existed. I thought about adding new things there, so I thought about doctype helper, something like this:

{% doctype "html" "4.1" "strict" %}

which is then rendered like this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">

What do you guys think about this. Should I implement this and open a ticket for it, or is it unnecessary? And I have some spare time nowadays, if someone comes up with better idea as a webdesign helper.

--
http://yasar.serveblog.net/

Russell Keith-Magee

unread,
Sep 30, 2011, 11:52:41 PM9/30/11
to django-d...@googlegroups.com
Honestly - it doesn't excite me that much. There aren't that many do types you have to worry about, and most halfway decent text editors will autocomplete them anyway. You're proposing to substitute one well understood format (the default docstring) for a comparatively obscure template tag format, in order to save a couple of keystrokes once per project. For my money, that's not worth it.

The good news is that if you disagree, you don't have to listen to me -- just write your own template tag libary, and prove me wrong when it becomes hugely popular :-)

I would also note that a search of the Django-dev archives will show that a doctype template tag has been proposed in the past, in a different context. Rather than just treating it as a web design plugin, it was proposed as an integrated part of form rendering. These proposals made the doctype tag do a whole lot more than just render the doctype; they also controlled form rendering. If you're interested, it might be worth looking into the historical record.

Yours,
Russ Magee %-)

Florian Apolloner

unread,
Oct 1, 2011, 3:58:02 AM10/1/11
to django-d...@googlegroups.com
Hi,

I think it's unnecessary, since nowadays many people tend to go towards html5 and there you usually just have "<!DOCTYPE HTML>" + it's something you put into the document once for a project, so I guess it would require more time to look up the tag than to lookup the doctype :) Plus you tag doesn't take custom doctypes into account, which are perfectly valid to use (at least for some browsers ;)):
<!DOCTYPE html SYSTEM "http://static.cdn.ubuntu-de.org/xhtml1-strict-uu.dtd">

Cheers,
Florian


Reply all
Reply to author
Forward
0 new messages