16 | | Note that Genshi will **not** be supported concurrently with Jinja2. |
17 | | If for some reason you're stuck to having to support Genshi templates, you'll have to stick to Trac 1.2.x. But you really should make the transition effort as Jinja2 templates are 5-10x faster than their Genshi equivalent, for a 1/5th of the cost in memory usage. |
| 17 | Note that Genshi will be supported concurrently with Jinja2 only for a short while, probably only during the 1.3.x development period. |
| 18 | If for some reason you're stuck to having to support Genshi templates, you'll have to stick to Trac 1.2.x or 1.3.x. But you really should make the transition effort as Jinja2 templates are 5-10x faster than their Genshi equivalent, for only a 1/5th of the cost in memory usage. |
| 19 | |
| 20 | |
| 21 | |
| 22 | == Changes in the HTML |
| 23 | |
| 24 | We took the opportunity to switch to HTML5 while performing this template overhaul. |
| 25 | You should probably do the same. |
| 26 | This usually won't change anything for your templates, except for a few details. |
| 27 | |
| 28 | The doctype and the <html> element should be changed from Genshi's: |
| 29 | {{{#!html+genshi |
| 30 | <!DOCTYPE html |
| 31 | PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" |
| 32 | "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
| 33 | <html xmlns="http://www.w3.org/1999/xhtml" |
| 34 | xmlns:py="http://genshi.edgewall.org/" |
| 35 | xmlns:i18n="http://genshi.edgewall.org/i18n" |
| 36 | xmlns:xi="http://www.w3.org/2001/XInclude"> |
| 37 | }}} |
| 38 | |
| 39 | to the somewhat simpler: |
| 40 | {{{#!xml |
| 41 | <!DOCTYPE html> |
| 42 | <html> |
| 43 | }}} |
| 44 | |
| 45 | Special care should be taken when dealing with //void elements//. |
| 46 | In XHTML, it's fine to write: |
| 47 | {{{#!xml |
| 48 | <div id="description"/> |
| 49 | }}} |
| 50 | However, when going to HTML5, you should use instead: |
| 51 | {{{#!xml |
| 52 | <div id="description"></div> |
| 53 | }}} |
| 54 | The valid [https://www.w3.org/TR/html-markup/syntax.html#void-elements void elements] in HTML5 are limited to the following list: |
| 55 | - area, base, br, col, command, embed, hr, img, input, keygen, link, meta, param, source, track, wbr |