Cheetah is an open source template engine and code generation tool.
yelp_cheetah is cheetah with everything we don't / shouldn't use removed.
#extends
under test.enable_auto_self
setting (always False
)useNameMapper
setting (always True
)auto_self
kwarg to getVar
and varExists
defaulting to True
(will default to False
and be removed in a future version).enable_auto_self
setting now defaults to False
$foo()bar
no longer compiles to foo.bar
._global_vars
with
the gettext functions.$()
and $[]
are now syntax errors -- use ${}
instead${ foo }
is now a syntax error -- placeholders cannot start with whitespace#def
enable_auto_self
setting (defaulted to True
) which (when enabled)
means $foo
can mean either self.foo
or NS['foo']
(the behaviour prior
to this version). In future versions, this will default to False
and will
eventually be eliminated.#call
directive (port to #with
instead)io.StringIO
as a replacement for DummyTransaction
setup_requires=['yelp-cheetah']
and yelp_cheetah={'directories': [...]}
to automatically build templates in a package on installation.#set
and #silent
(replaced by #py
)$self.getVar('contains_underscore')
[$x for x in ...]
useAutocalling
setting (always False)useDottedNotation
setting (always False)mainMethodName
setting (always respond)mainMethodNameForSubclasses
setting (always writeBody)valueForName
(now unused)namespace
instead of searchList$foo($bar='baz') => $foo(bar='baz')
#filter
directive is gone. Use self.set_filter(filter_fn)
Template
's signature is now Template(search_list, filter_fn)
from __future__ import absolute_import
#with
instead.cheetahVarStartToken
, commentStartToken
, directiveStartToken
, directiveEndToken
#py
directive. This will replace #silent
and #set
in a future version<% ... %>
YelpCheetahTemplate
as the classnamelocals()
, globals()
, builtins
, self
, searchList
#extends
no longer supports #extends foo.foo
and should instead be #extends foo
**KWS
is no longer added to every template method definition$translator.gettext(...)
gettext
, pgettext
, npgettext
).for
lvalues#set global
directivefuture_unicode_literals
settinggetVar
/ varExists
__init__.py
in __pycache__
directories__init__.py
in subdirectoriescheetah-compile
takes directories#def
/ #block
name#def
#block
#set
lvalue#attr
lvalue@classmethod
/ @staticmethod
#set module
directivecompile_directories
#with
directivemarkupsafe
filterCheetah.partial_template
, a system for importable template functions.Cheetah.Compiler
and Cheetah.Parser
to Cheetah.legacy_compiler
and Cheetah.legacy_parser
#encoding
directive, cheetah source is now invariantly UTF-8
#echo
directive#* ... *#
multiline comment syntax#arg
directive#closure
directive<%=...%>
#implements
#extends
#compiler
directivesys
, os
, os.path
, builtin
, getmtime
, exists
, types
)useDottedNotation
to falseallowNestedDefScopes
settinguseSearchList
settinguseKWsForPassingTrans
settingalwaysFilterNone
setting#if ... then ... else ...
directivenamespace
argument from Template.__init__
__YELP_CHEETAH__ = True
in compiled sourceautoImportForExtends
setting (always True)#extends
of an imported namefuture_unicode_literals
for toggling unicode_literals
in compiled source#cache
directive$!placeholder
)#errorCatcher
directive#indent
directivec'$var'
syntax#I18n
macrotime
, currentTime
, etc.)#unicode
directive#breakpoint
directive#unless
directive#repeat
directive#capture
directivecompile_source
, compile_file
, compile_to_class
)#defmacro
directive#include
directivegetFileContents
addSrcTimeToOutput
settingdisabledDirectives
settingpre
/ post
ParseDirective
hooksI18NFunctionName
EmptySingleLineMethods
settingallowWhitespaceAfterDirectiveStartToken
templateMetaclass
settingunicode
for compiling source#transform
directiveWebsafe
, Markdown
, CodeHighlight
, Maxlen
, Strip
filtersBaseFilter
namespaces
argument for Template
constructor#stop
directiveuseFilters
setting (always True)allowPlaceholderFilterArgs
settingencoding
settingEOLSlurp
feature#raw
directiveoutputMethodsBeforeAttributes
settingdefDocStrMsg
settinghandlerForExtendsDirective
setting__str__
from all objectsuseStackFrames
setting#importsettings
directive#compiler-settings python
directivesafeConvert
*
imports