template filename output in html

28 views
Skip to first unread message

Andi Balke

unread,
Jul 14, 2012, 10:18:05 AM7/14/12
to pylons-discuss
hi, 

i was wondering if it is somehow generally possible to add debug information to templates beeing rendered::

  <!-- begin: some/widget/view.mak -->
  …
  <!-- end: some/widget/view.mak --> 

e.g. in the "old times" with svn this was easy by using ``$Id$`` in the top of a template file; in gwt there is  an option that renders the filename of a template to the html.  

does anyone have a good hint for accomplishing this? either by hacking the renderer or something else. in the best information about templates beeing rendered would be visible only in development mode. 

cheers, andi

Jonathan Vanasco

unread,
Jul 14, 2012, 8:46:34 PM7/14/12
to pylons-discuss
if you're using Mako, you can use ## , which comments out the line.
that will never render and isn't automatically created on imports.

you could also use a build script - either with Fabfile or Ant ( like
the html5 blueprint build script )... have a source "folder" that is
your production , then run the build script to export it into
something developer friendly ( ie, remove ## from comment lines, wrap
include commands with comments, etc ). that would be rather easy,
except for template functions, though they could use explicit
commenting
Reply all
Reply to author
Forward
0 new messages