Genshi (templating language)

Genshi (templating language)

Infobox_Software
name = Genshi

developer =
latest_release_version= 0.5.1
latest_release_date =
operating_system = Cross-platform
genre = Template Engine
license =
website = [http://genshi.edgewall.org/ http://genshi.edgewall.org/]

Genshi is a template engine for XML-based vocabularies written in
Python. Genshi is used to easily insert generated output into XML-based languages, usually HTML, and reuse elements between documents. Genshi is based on Kid and aims to implement some of its functionality while processing templates faster. [cite web|url=http://genshi.edgewall.org/wiki/GenshiFaq#WhatisGenshi|title=What is Genshi?|accessdate=2008-01-20]

Genshi's can be used with several Python web frameworks, such as TurboGears [cite web|url=http://docs.turbogears.org/1.0/GenshiTemplating|title=Genshi Templating|accessdate=2008-01-20] and Pylons. [cite web|url=http://wiki.pylonshq.com/display/pylonscookbook/Genshi+templates|title=Genshi Templates - Pylons Cookbook|accessdate=2008-01-20] Genshi will eventually replace Kid in the TurboGears web framework. [cite web|url=http://compoundthinking.com/blog/index.php/2007/06/27/turbogears-11-and-beyond/|title=TurboGears 1.1 and Beyond|last=Ramm|first=Mark|accessdate=2008-01-20]

Genshi Markup

Genshi makes use of namespaces to embed instructions into HTML. A typical instruction is given as an , with a Python expression inside the quotes. For example, the following will render a paragraph that shows 4:

This will be replaced with 4

Because of the use of namespaces, Genshi can be used in WYSIWYG HTML editors. [cite web|url=http://www.cherrypy.org/wiki/ChoosingATemplatingLanguage#Genshi|title=Choosing a templating language|accessdate=2008-01-20]

Differences between Kid and Genshi

* Genshi directly interprets templates (unlike Kid, which generates Python code)cite web|url=http://genshi.edgewall.org/wiki/GenshiVsKid|title=Comparing Genshi to Kid|accessdate=2008-01-20]
* Genshi uses XInclude for template reuse
* Genshi adds attributes Kid does not have, like py:choose

References

External links

* [http://genshi.edgewall.org/ Genshi official website]
* [http://genshi.edgewall.org/wiki/GenshiTutorial Genshi tutorial]


Wikimedia Foundation. 2010.

Игры ⚽ Нужно сделать НИР?

Look at other dictionaries:

  • Genshi — may refer to: * Genshi Media Group, an independent record label * Genshi (templating language), an XML templating language for Python * jido genshi, an experimental electronic music project …   Wikipedia

  • Kid (templating language) — Kid is a simple template engine for XML based vocabularies written in Python. Kid claims to have many of the best features of XSLT, TAL, and PHP, but with much of the limitations and complexity stamped out .While kid was heavily hyped by the… …   Wikipedia

  • Kid (Templating Language) — Kid простой механизм шаблонов базирующийся на XML словарях, написанный на Python. Kid претендует на многие положительные черты XSLT, TAL и PHP, при этом не перенимая их отрицательные стороны. Хотя kid широко использовался в TurboGears, он все… …   Википедия

  • Genshi — Пожалуйста, улучшите и дополните этот раздел. Замечания о том, что нужно улучшить, могут быть на странице обсуждения статьи …   Википедия

  • Comparison of code generation tools — This article compares variable metamodel code generation tools[clarification needed]. Fixed metamodel code generation tools, such as UML tools, are excluded (see List of UML tools). Name Creator OS First public release Latest stable version… …   Wikipedia

  • CherryPy — Developer(s) CherryPy team Stable release 3.2.0 / February 25, 2011; 8 months ago (2011 02 25) Written in Python …   Wikipedia

  • Pylons (web framework) — Infobox Software name = Pylons latest release version = 0.9.6.2 latest release date = May 28, 2008 genre = Web application framework license = BSD License programming language = Python operating system = Cross platform website =… …   Wikipedia

  • Сравнение каркасов веб-приложений — Это сравнительная таблица фреймворков веб приложений. Содержание 1 Фреймворки 1.1 ASP.NET 1.2 C++ 1.3 ColdFusion Markup Language (CFML) …   Википедия

  • TurboGears — Infobox Software name = TurboGears developer = [http://www.blueskyonmars.com/ Kevin Dangoor] et al. latest release version = 1.0.7 latest release date = September 15, 2008 programming language = Python operating system = Cross platform genre =… …   Wikipedia

  • Comparison of web application frameworks — This is a comparison of notable web application frameworks. Contents 1 General 1.1 Perl 1.2 PHP 1.3 Java 1.4 Python …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”