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.)
39 > * Use figure and figcaption for captions in img. However, I have not
40 > managed to style it to look as good as the current table+caption
45 # htmlscrubber.pm needs to not scrub new HTML5 elements
47 * [new elements](http://www.w3.org/TR/html5-diff/#new-elements)
51 > Things I left out, too hard to understand today:
52 > Attributes contenteditable,
53 > data-\*, draggable, role, aria-\*.
54 > Tags command, keygen, output.
56 > Clearly unsafe: embed.
58 > Apparently cannot be used w/o javascript: menu.
60 > I have not added the new `ping` attribute, because parsing a
61 > space-separeated list of urls to avoid javascript injection is annoying,
62 > and the attribute seems generally dubious.
65 # HTML5 Validation and t/html.t
67 [validator.nu](http://validator.nu/) is the authorative HTML5 validator,
68 however it is almost impossible to sanely introduce as a build dependency
69 because of its insane Java requirements. :( I test locally via
70 [cURL](http://wiki.whatwg.org/wiki/IDE), though Debian packages cannot be built
71 with a network dependency.
73 In the future, hopefully ikiwiki can test for valid HTML5 using [Relax NG
74 schema](http://syntax.whattf.org/) using a Debian package tool
75 [rnv](http://packages.qa.debian.org/r/rnv.html).
77 > Validation in the test suite is nice, but I am willing to lose those
78 > tests for a while. --[[Joey]]
80 # HTML5 migration issues
82 # [article](http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#the-article-element) element
84 This element is poorly supported by browsers. As a workaround, `style.css` needs:
90 Internet Explorer will display it as a block, though you can't seem to be able to further control the style.
92 > done (needed for header too) --[[Joey]]
96 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).
100 au:~% grep timeformat natalian.setup
101 timeformat => '%Y-%m-%d',
103 > Also, the [[plugins/relativedate]] plugin needs to be updated to
104 > support relatatizing the contents of time elements. --[[Joey]]
106 > Done and done; in html5 mode it uses the time tag, and even
107 > adds pubdate when displaying ctimes. --[[Joey]]
111 Will reformat html5 to html4.
116 Ok, I consider this [[done]], at least as a first pass. Html5 mode
117 is experimental, but complete enough. --[[Joey]]