Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #2407 (closed task: fixed)

Opened 10 years ago

Last modified 10 years ago

Support Genshi in TG widget templates

Reported by: chrisz Owned by: chrisz
Priority: normal Milestone: 1.5
Component: TurboGears Version: 1.1
Severity: normal Keywords: genshi kid widgets


Since TurboGears 1.1 it is possible to use Genshi for page templates, and Genshi has become the default templating engine for TurboGears. Quickstarted projects are created with Genshi templates now. Yet, native TG widgets still can only work with Kid templates; Genshi for widget templates is only possible through ToscaWidgets.

This is a very inconsistent and unsatisfaying state of affairs. TG widgets really should support Genshi templates nowadays, and all the widgets provided by TurboGears should come with Genshi templates instead of Kid templates. This will improve performance, allows us to get rid of the Kid dependency and avoids incompatibilities between the page and widget templating (e.g. #2390).

However, because in the TG 1.x branch backward compatibility is a crucial issue (the main reason why we still are keeping TG 1.x alive), the native TG widgets should still support Kid templates, and the TG widget system should automatically convert the output between templating engines (from Genshi's MarkupStream to Kid's ElementStream and vice versa).

Change History

comment:1 Changed 10 years ago by chrisz

I've created the 1.5-genshi-widgets branch for working on this issue.

comment:2 Changed 10 years ago by chrisz

After a larger clean-up operation in the widgets package in r6949, the main work has now been accomplished in r6954.

Still to be done:

  • Convert templates for all widgets included with TG from Kid to Genshi
  • Switch the default_engine for TG widgets from Kid to Genshi
  • Shall we make the default_engine configurable?
  • Add some more test, e.g. for displaying a Genshi widget with Kid subwidgets on a Kid page, and displaying a Kid widget with Genshi subwidgets on a Genshi page
  • Add some documentation, particularly for the new engine_name attribute
  • Should we set engine_name by default to None (i.e. try to derive the engine from the template), or to 'genshi'? The former will be a bit more backward compatible: Pld widgets with Kid templates and no engine_name attribute would inherit the engine_name='genshi' setting, i.e. try to render the Kid template with Genshi.

comment:3 Changed 10 years ago by Chris Arndt

  • Owner set to chrisz

Work continued and ready for review in r6957, r6958, r6959, r6961, r6962, r6963.

comment:4 Changed 10 years ago by Chris Arndt

Documentation added to the wiki here:  http://docs.turbogears.org/1.5/WidgetTemplateEngine

comment:5 Changed 10 years ago by chrisz

Demo/Benchmark? added to the wiki page above.

comment:6 Changed 10 years ago by chrisz

  • Status changed from new to closed
  • Resolution set to fixed

This has now been merged back to the main 1.5 branch in r6989.

Note: See TracTickets for help on using tickets.