Edgewall Software

Changes between Version 14 and Version 15 of TracDev/Proposals/Jinja


Ignore:
Timestamp:
Feb 23, 2016, 12:30:44 AM (8 years ago)
Author:
Christian Boos
Comment:

add some more links to PortingFromGenshiToJinja

Legend:

Unmodified
Added
Removed
Modified
  • TracDev/Proposals/Jinja

    v14 v15  
     1[[PageOutline(2-3)]]
    12= Add Support for the Jinja2 Template Engine
    23
     
    1011   - 127/898 plugins (14.1%) on trac-hacks.org use `filter_stream()`
    1112   - see [PortingFromGenshiToJinja#ReplacingITemplateStreamFilter replacing ITemplateStreamFilter]
    12  * how to handle themeing? see [#Themeing]
    13  * should we rewrite tag builders or use lightweight string templates? -> `tag` `Fragment`/`Element` builder has been replaced, and is backward compatible
     13 * how to handle themeing? see [#Themeing] below
     14 * should we rewrite tag builders or use lightweight string templates? -> [PortingFromGenshiToJinja#tag tag] `Fragment`/`Element` builder has been replaced, and is backward compatible
    1415 * others?
    1516
     
    6566
    6667=== Themeing
     68
     69We summarize the current template page architecture we use since the adoption of the Genshi template engine (i.e. since Trac 0.11), before describing the new but similar template page architecture that we'll use with the Jinja2 template engine.
     70
    6771==== Genshi theme
    6872I've never really tried the TH:ThemeEnginePlugin plugin, or alternatives, so I can't be sure if I got it right, but from what I can see in Trac's code base itself, the idea with Genshi-based themeing (and page architecture in general) was to have a dynamically loaded "theme" template page that would primarily be in charge of the main structure of all HTML pages.
     
    378382
    379383== Genshi to Jinja2 Migration
     384
     385Some systematic comparison of the Genshi and Jinja2 template syntax can be seen in PortingFromGenshiToJinja#Changesinthetemplatesyntax (modeled after the old PortingFromClearSilverToGenshi page).
    380386
    381387=== Conversion example