2 [HTML5](http://www.whatwg.org/specs/web-apps/current-work/multipage/) can be
3 safely supported by ikiwiki. There are [several differences between HTML4 and
4 HTML5](http://www.w3.org/TR/html5-diff/).
6 [[!template id=gitbranch branch=hendry/html5 author="[[Kai_Hendry|hendry]]"]]
8 * [HTML5 branch](http://git.webconverger.org/?p=ikiwiki;h=refs/heads/html5)
9 * [ikiwiki instance with HTML5 templates](http://natalian.org)
10 * [HTML5 outliner tool](http://gsnedders.html5.org/outliner/) -- to check you have the structure of your markup correct
12 > Kai, thanks enormously for working on this. I switched a page to
13 > the html5 doctype today, and was rather pleasently suprised that it
14 > validated, except for the new Cache-Control meta tag. Now I see you're
15 > well ahead of me. --[[Joey]]
17 > So, how should ikiwiki support html5? There are basically 3 approaches:
19 > 1. Allow users to add html5 tags to their existing xhtml pages.
20 > What has been done so far, can be extended. Basically works
21 > in browsers, if you don't care about standards. A good prerequisite
22 > for anything else, anyway.
23 > 2. Switch to html5 in eg, ikiwiki 4; users have to deal with
24 > any custom markup on their pages/templates that breaks then.
25 > 3. Have both a html5 and a xhtml mode, allow user to select.
27 > The third option seems fairly tractable from what I see here and in
28 > your branch. You made only relatively minor changes to 10 templates.
29 > It would probably not be too dreadful to put them in ifdefs.
31 > Some of your changes are obvious, like using the new `time` and
32 > and `article` elements. Others less so, and I'm particularly
35 > * Removing the value="Submit" from the button on the
36 > commentmoderation form.
37 > * Removing feedlink.tmpl. What?!
38 > * Using a `h2` for the header of inlinepage.tmpl and page.tmpl, rather
39 > than the styled span. Ikiwiki has
40 > [[a_reason|todo/Option_to_make_title_an_h1?]] for not
41 > using real `hN` for the header atop a page and here.
42 > AFAICS, html5 does not invalidate that.
43 > * Removing Editurl from inlinepage.tmpl actions. I assume
44 > this is your own preference, needs to be removed from branch
45 > before I can use it.
46 > * Removing the pageheader, content, and footer divs
47 > which are all used by style.css.
48 > Perhaps, the style sheet needs to be updated to use
49 > the new elements, like the `footer` and `header`.
50 > * Removal of the favicon from page.tmpl. Surely html5 supports?
51 > * Removal of BASEURL from page.tmpl, apparently a mistake.
52 > * Removal of the `/` between wiki title and page title.
53 > Personal preference.
54 > * Removal of `comments` div, which is there to be styled.
55 > * Why use a `p` rather than the `div` for `addcomments`?
56 > * Moving the action bar to the bottom of the page.
57 > Personal preference.
58 > * Clearly searchquery.tmpl has no business using bad old `center`
59 > tag, but something should still be done to replace it.
61 > (BTW, it would be helpful if you could re-merge master into your branch
62 > as it is a bit diverged now.)
66 > * Add pubdate attribute to time elements as appropriate.
67 > * Use aside for the sidebar? Or for the [[templates/note]] template?
68 > * Use nav for the actionbar
71 # htmlscrubber.pm needs to not scrub new HTML5 elements
73 * [new elements](http://www.w3.org/TR/html5-diff/#new-elements)
75 > Most of these can be supported trivially, since they are just semantic
76 > markup. Make a list of these, and their attributes (and which attributes
77 > can contain urls or other javascript injection mechanisms), and I can add
78 > them. (Added several now.) Others, like `embed` are *scary*. --[[Joey]]
80 # HTML5 Validation and t/html.t
82 [validator.nu](http://validator.nu/) is the authorative HTML5 validator,
83 however it is almost impossible to sanely introduce as a build dependency
84 because of its insane Java requirements. :( I test locally via
85 [cURL](http://wiki.whatwg.org/wiki/IDE), though Debian packages cannot be built
86 with a network dependency.
88 In the future, hopefully ikiwiki can test for valid HTML5 using [Relax NG
89 schema](http://syntax.whattf.org/) using a Debian package tool
90 [rnv](http://packages.qa.debian.org/r/rnv.html).
92 > Validation in the test suite is nice, but I am willing to lose those
93 > tests for a while. --[[Joey]]
95 # HTML5 migration issues
97 # [article](http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#the-article-element) element
99 This element is poorly supported by browsers. As a workaround, `style.css` needs:
105 Internet Explorer will display it as a block, though you can't seem to be able to further control the style.
109 The [time element](http://www.whatwg.org/specs/web-apps/current-work/multipage/text-level-semantics.html#the-time-element) ideally needs the datatime= attribute set by a template variable with what [HTML5 defines as a valid datetime string](http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#valid-global-date-and-time-string).
113 au:~% grep timeformat natalian.setup
114 timeformat => '%Y-%m-%d',
116 > Also, the [[plugins/relativedate]] plugin needs to be updated to
117 > support relatatizing the contents of time elements. --[[Joey]]