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 > I've made ikiwiki use the time element and all the new semantic elements
37 > * Use details tag instead of the javascript in the toggle plugin.
38 > (Need to wait on browser support probably.)
42 # htmlscrubber.pm needs to not scrub new HTML5 elements
44 * [new elements](http://www.w3.org/TR/html5-diff/#new-elements)
48 > Things I left out, too hard to understand today:
49 > Attributes contenteditable,
50 > data-\*, draggable, role, aria-\*.
51 > Tags command, keygen, output.
53 > Clearly unsafe: embed.
55 > Apparently cannot be used w/o javascript: menu.
57 > I have not added the new `ping` attribute, because parsing a
58 > space-separeated list of urls to avoid javascript injection is annoying,
59 > and the attribute seems generally dubious.
62 # HTML5 Validation and t/html.t
64 [validator.nu](http://validator.nu/) is the authorative HTML5 validator,
65 however it is almost impossible to sanely introduce as a build dependency
66 because of its insane Java requirements. :( I test locally via
67 [cURL](http://wiki.whatwg.org/wiki/IDE), though Debian packages cannot be built
68 with a network dependency.
70 In the future, hopefully ikiwiki can test for valid HTML5 using [Relax NG
71 schema](http://syntax.whattf.org/) using a Debian package tool
72 [rnv](http://packages.qa.debian.org/r/rnv.html).
74 > Validation in the test suite is nice, but I am willing to lose those
75 > tests for a while. --[[Joey]]
77 # HTML5 migration issues
79 # [article](http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#the-article-element) element
81 This element is poorly supported by browsers. As a workaround, `style.css` needs:
87 Internet Explorer will display it as a block, though you can't seem to be able to further control the style.
89 > done (needed for header too) --[[Joey]]
93 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).
97 au:~% grep timeformat natalian.setup
98 timeformat => '%Y-%m-%d',
100 > Also, the [[plugins/relativedate]] plugin needs to be updated to
101 > support relatatizing the contents of time elements. --[[Joey]]
103 > Done and done; in html5 mode it uses the time tag, and even
104 > adds pubdate when displaying ctimes. --[[Joey]]
108 Will reformat html5 to html4.