Edgewall Software

Changes between Version 40 and Version 41 of GenshiFaq


Ignore:
Timestamp:
Sep 5, 2007, 2:00:33 PM (12 years ago)
Author:
cmlenz
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GenshiFaq

    v40 v41  
    4848=== What are the main differences between Kid and Genshi? ===
    4949
    50 Genshi executes templates directly, there's no code generation phase. Expressions are evaluated in a more forgiving way using AST transformation. Template variables are stored on a stack, which means that some variable set in a loop deep in the template won't leak into the rest of the template. And even though Genshi doesn't generate Python code for templates, it generally [wiki:GenshiPerformance performs] slightly better than Kid (even up to 2x in [source:/trunk/examples/basic/ some of our tests], but the exact differences depend on a lot of factors).
     50Genshi executes templates directly, there's no code generation phase. Expressions are evaluated in a more forgiving way using AST transformation. Template variables are stored on a stack, which means that some variable set in a loop deep in the template won't leak into the rest of the template. And even though Genshi doesn't generate Python code for templates, it generally [wiki:GenshiPerformance performs] better than Kid (over 2x in [source:/trunk/examples/bench/ our benchmarks], but the exact difference depends on a lot of factors).
    5151
    5252Genshi does not depend on !ElementTree. It uses Expat for parsing XML, and is based on streaming slightly abstracted parse events through the processing pipeline. It uses [http://www.w3.org/TR/xinclude/ XInclude] – instead of Kids' `py:extends` – to allow template authors to factor out common bits. For match templates, it uses [http://www.w3.org/TR/xpath XPath] expressions instead of the !ElementTree API.
     
    6262=== What do I need to use Genshi? ===
    6363
    64 Python 2.3 or later. Python 2.4 is recommended for better performance, plus error messages will include template line numbers and column offsets. [http://peak.telecommunity.com/DevCenter/setuptools Setuptools] is optional and only used for installation if it's available.
    65 
    66 The [wiki:Documentation/plugin.html template engine plugin], which enables usage of Genshi in frameworks such as TurboGears or [GenshiRecipes/PylonsWithGenshi Pylons], depends on Setuptools at runtime and installation time. Use of the plugin implementation is optional, though: Setuptools is ''not'' required for using Genshi directly.
     64Python 2.3 or later. Python 2.4 is recommended for better performance, plus error messages will include template line numbers and column offsets. Python 3 does '''not''' work. Alternative implementations of Python such as [http://pypy.org/ PyPy], [http://www.jython.org/ Jython], or [http://www.codeplex.com/Wiki/View.aspx?ProjectName=IronPython IronPython] are also unlikely to work due to the Genshi code using some rather advanced features of the CPython implementation and standard library.
     65
     66[http://peak.telecommunity.com/DevCenter/setuptools Setuptools] is optional and only used for installation if it's available. The [wiki:Documentation/plugin.html template engine plugin], which enables usage of Genshi in frameworks such as TurboGears or [GenshiRecipes/PylonsWithGenshi Pylons], depends on Setuptools at runtime and installation time. Use of the plugin implementation is optional, though: Setuptools is ''not'' required for using Genshi directly.
    6767
    6868=== Why is it called “Genshi”? ===