File: api-simpletalutils.html

package info (click to toggle)
python3-simpletal 5.2-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 812 kB
  • sloc: python: 5,797; xml: 23; makefile: 6
file content (32 lines) | stat: -rw-r--r-- 2,542 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
	<title>SimpleTAL API: simpleTALUtils Module.</title>
	<link href="../style/site.css" type="text/css" rel="stylesheet">
</head>
<body>
<h1>SimpleTAL API: simpleTALUtils Module.</h1>
  <p id="subject">Documentation on how to use the simpleTALUtils Module.</p>
  <div><h2>simpleTALUtils</h2>
<p>This module holds optional classes and functions that might be of use while using SimpleTAL, but are not required by SimpleTAL directly.</p>
<h3>def ExpandMacros (context, template, outputEncoding="utf-8")</h3>
<p>This function can be used to expand a template which contains METAL macros, while leaving in place all the TAL and METAL commands.&nbsp; Doing this makes editing a template which uses METAL macros easier, because the results of the macro can be seen immediately.</p>
<p>The macros referred to by the passed in template must be present in the context so that their contents can be referenced.&nbsp; The outputEncoding determines the encoding of the returned string, which will contain the expanded macro.</p>
<h3>TemplateCache</h3>
<p>This class implements a cache for compiled templates which automatically invalidates entries when their template file changes.&nbsp; The instance has one public method: getTemplate</p>
<h4>getTemplate (name, inputEncoding="utf-8")</h4>
<p>This method will return a compiled template from the file 'name'.&nbsp; If the file ends in '.xml' it will be compiled using simpleTAL.compileXMLTemplate, otherwise it will be compiled as a HTML template.&nbsp; If the method is called again it will check to see whether the file 'name' has changed since the last call, and if it has it will re-compile the template,otherwise it will return the cached version.</p>
<p>HTML Templates will be taken as being stored in the "inputEncoding", XML templates ignore this parameter.</p>
<h4>getXMLTemplate (name)</h4>
<p>This method will return a compiled XML template from the file 'name'.&nbsp; This works identically to getTemplate as described above, except that it always treats the template as XML.</p>
<p><a href="api.html">Back to SimpleTAL API</a></p>
</div>
	  
  <p id="version">PubTal Version </p>
  <div id="footer">
  <p>File: api-simpletalutils.txt</p>
  <p>Last modified: Sat, 15 Aug 2009 12:30:36 BST</p>
  <p>Copyright 2011 Colin Stewart</p>
  <p title="PubTal is a template driven web site publisher.">Made with <a href="http://www.owlfish.com/software/PubTal/">PubTal</a> 3.5</p>
  </div>
</body>