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. Have both a html5 and a xhtml mode, allow user to select.
24 > 3. Switch to html5 in eg, ikiwiki 4; users have to deal with
25 > any custom markup on their pages/templates that breaks then.
27 > The second 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. I've made a
30 > small start at doing that.
32 > Some of your changes are obvious, like using the new `time` and
33 > and `article` elements. Others less so, and I'm particularly
36 > * Removing the value="Submit" from the button on the
37 > commentmoderation form.
38 > * Removing feedlink.tmpl. What?!
39 > * Using a `h2` for the header of inlinepage.tmpl and page.tmpl, rather
40 > than the styled span. Ikiwiki has
41 > [[a_reason|todo/Option_to_make_title_an_h1?]] for not
42 > using real `hN` for the header atop a page and here.
43 > AFAICS, html5 does not invalidate that.
44 > * Removing Editurl from inlinepage.tmpl actions. I assume
45 > this is your own preference, needs to be removed from branch
46 > before I can use it.
47 > * Removing the pageheader, content, and footer divs
48 > which are all used by style.css.
49 > Perhaps, the style sheet needs to be updated to use
50 > the new elements, like the `footer` and `header`.
51 > * Removal of the favicon from page.tmpl. Surely html5 supports?
52 > * Removal of BASEURL from page.tmpl, apparently a mistake.
53 > * Removal of the `/` between wiki title and page title.
54 > Personal preference.
55 > * Removal of `comments` div, which is there to be styled.
56 > * Why use a `p` rather than the `div` for `addcomments`?
57 > * Moving the action bar to the bottom of the page.
58 > Personal preference.
59 > * Clearly searchquery.tmpl has no business using bad old `center`
60 > tag, but something should still be done to replace it.
62 > (BTW, it would be helpful if you could re-merge master into your branch
63 > as it is a bit diverged now.)
67 > * Add pubdate attribute to time elements as appropriate.
68 > * Use aside for the sidebar? Or for the [[templates/note]] template?
69 > * Use nav for the actionbar
70 > * Use placeholder in the search box. Allows closing
71 > [[this_todo|Add_label_to_search_form_input_field]]
72 > * Use details tag instead of the javascript in the toggle plugin.
73 > (Need to wait on browser support probably.)
77 # htmlscrubber.pm needs to not scrub new HTML5 elements
79 * [new elements](http://www.w3.org/TR/html5-diff/#new-elements)
83 > Things I left out, too hard to understand today:
84 > Attributes contenteditable,
85 > data-\*, draggable, role, aria-\*.
86 > Tags command, keygen, output.
88 > Clearly unsafe: embed.
90 > Apparently cannot be used w/o javascript: menu.
92 > I have not added the new `ping` attribute, because parsing a
93 > space-separeated list of urls to avoid javascript injection is annoying,
94 > and the attribute seems generally dubious.
97 # HTML5 Validation and t/html.t
99 [validator.nu](http://validator.nu/) is the authorative HTML5 validator,
100 however it is almost impossible to sanely introduce as a build dependency
101 because of its insane Java requirements. :( I test locally via
102 [cURL](http://wiki.whatwg.org/wiki/IDE), though Debian packages cannot be built
103 with a network dependency.
105 In the future, hopefully ikiwiki can test for valid HTML5 using [Relax NG
106 schema](http://syntax.whattf.org/) using a Debian package tool
107 [rnv](http://packages.qa.debian.org/r/rnv.html).
109 > Validation in the test suite is nice, but I am willing to lose those
110 > tests for a while. --[[Joey]]
112 # HTML5 migration issues
114 # [article](http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#the-article-element) element
116 This element is poorly supported by browsers. As a workaround, `style.css` needs:
122 Internet Explorer will display it as a block, though you can't seem to be able to further control the style.
126 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).
130 au:~% grep timeformat natalian.setup
131 timeformat => '%Y-%m-%d',
133 > Also, the [[plugins/relativedate]] plugin needs to be updated to
134 > support relatatizing the contents of time elements. --[[Joey]]