Tayra

Template. Script. Distribute

tayra – Tayra template language

Tayra is a full-featured abstract markup language to template web documents. It is primarily inspired from mako-templates and HAML (especially the indentation based markup definitions). Although it is young and relatively a new kid among the old-timers, it can be considered as the evolutionary next step for some of them. And probably it is the only templating language that allows developers to build and distribute their templates as plugins, not to mention the fact that tayra’s implementation itself is heavily based on plugins.

Module contents

tayra.loadttls(pa, ttlfiles, compiler_setts={})[source]

Load tayra template files implementing template plugins. package() entry point, that will be called during pluggdapps pre-booting, can use this API to load ttl files.

pa,
Pre-boot version of the platform coming via pacakge() entry point.
ttlfiles,
List of tayra template files, implementing template plugins, in asset specification format.
compiler_sett,
Dictionary of settings for TTLCompiler plugin to override the default configuration, configuration settings from master ini file and backed data store.
tayra.package(pa)[source]

Pluggdapps package must implement this entry point. This function will be called during platform pre-booting. Other than some initialization stuff, like dynamically loading template plugins using loadttls(), this entry point must return a dictionary of key,value pairs describing the package.

tayra.translatefile(ttlfile, compiler, options)[source]

Using an instance of TTLCompiler compiler, and command line options, translate ttlfile into corresponding HTML file. The intermediate .py file and the final HTML file are saved in the same directory as that of the ttlfile. options is expected to have attributes, args, context.

class tayra.BaseTTLPlugin(pa, *args, **kwargs)[source]

Bases: pluggdapps.plugin.Plugin

Base class for all plugins implementing one or more template interfaces. Developers need not worry about this. Code generator and runtime will automatically create a blueprint, using this class, from template-plugins. Provided the plugin is declared using @implement directive,:

@implement tayra.interfaces:ITayraTestInterface as XYZTestInterface
classmethod default_settings()[source]

pluggdapps.plugin.ISettings.default_settings() interface method.

classmethod normalize_settings(sett)[source]

pluggdapps.plugin.ISettings.normalize_settings() interface method.

Table Of Contents

Related Topics

This Page