ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> komodo-discuss
komodo-discuss
Re: [Komodo-discuss] template-toolkit syntax checker
by Trent Mick other posts by this author
Jul 11 2008 3:02PM messages near this date
view in the new Beta List Site
[Komodo-discuss] template-toolkit syntax checker | Re: [Komodo-discuss] template-toolkit syntax checker
Ã?ric Cholet wrote:
>  I don't understand how the TT file type works.
>  First of all, it seems to think that TT is used only for HTML files:
>  
>  [% foo %]

Yes, granted. Our expectation was that the *primary* usage of templates 
in the various template languages we support (TemplateToolkit, Django, 
RHTML, Mason, etc.) was for HTML. Komodo needs to define a few different 
language types for each template language, e.g.:
	TemplateToolkit HTML Template
	TemplateToolkit XML Template
	TemplateToolkit Text Template

You can see a start at exploring that in "langinfo_template.py" in your 
Komodo installation. However, that code isn't be used for Komodo 
document language type yet.

>  Ok, let's do HTML then:
>  
>  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/
xhtml1-strict.dtd 
>  ">
>  [% FILTER collapse %]
>  <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
>  <head>
>  <title>foo</title>
>  </head>
>  <body>bar</body>
>  </html>
>  
>  the [% FILTER collapse %] line has this:
>  => Warning plain text isn't allowed in <head> elements
>  and then a bunch of other warnings which seem a consequence of this  
>  first one.
>  
>  Removing this TT directive makes the syntax check pass.

This is because Komodo is using HTML Tidy to syntax check your 
TemplateToolkit file. While an HTML template is *close* to HTML, it 
isn't strictly valid HTML -- hence the warnings.

Cheers,
Trent

-- 
Trent Mick
trentm at activestate.com
_______________________________________________
Komodo-discuss mailing list
Komodo-discuss@[...].com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Other options: http://listserv.ActiveState.com/mailman/listinfo/Komodo-discuss
Thread:
cholet
Trent Mick
cholet
Trent Mick
cholet
R. Hicks

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved