]> sipb.mit.edu Git - ikiwiki.git/blob - doc/bugs/html5_support.mdwn
3d16893012a9f41cbd6bfffc04cd8cd4f21f4f1d
[ikiwiki.git] / doc / bugs / html5_support.mdwn
1 Some elements of
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/).
5
6 [[!template id=gitbranch branch=hendry/html5 author="[[Kai_Hendry|hendry]]"]]
7
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
11
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]] 
16
17 > So, how should ikiwiki support html5? There are basically 3 approaches:
18
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.
26
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.
31
32 > I've made ikiwiki use the time element and all the new semantic elements
33 > in html5 mode.
34
35 > Other ideas:
36 >  
37 > * Use details tag instead of the javascript in the toggle plugin. 
38 >   (Need to wait on browser support probably.)
39
40 > --[[Joey]] 
41
42 # htmlscrubber.pm needs to not scrub new HTML5 elements
43
44 * [new elements](http://www.w3.org/TR/html5-diff/#new-elements)
45
46 > Many added now.
47 >
48 > Things I left out, too hard to understand today:
49 > Attributes contenteditable,
50 > data-\*, draggable, role, aria-\*.
51 > Tags command, keygen, output.
52
53 > Clearly unsafe: embed.
54
55 > Apparently cannot be used w/o javascript: menu.
56
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.
60 >  --[[Joey]] 
61
62 # HTML5 Validation and t/html.t
63
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.
69
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).
73
74 > Validation in the test suite is nice, but I am willing to lose those
75 > tests for a while. --[[Joey]] 
76
77 # HTML5 migration issues
78
79 # [article](http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#the-article-element) element
80
81 This element is poorly supported by browsers. As a workaround, `style.css` needs:
82
83         article {
84                 display: block;
85         }
86
87 Internet Explorer will display it as a block, though you can't seem to be able to further control the style.
88
89 > done  (needed for header too) --[[Joey]] 
90
91 ## Time element
92
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).
94
95 As a workaround:
96
97         au:~% grep timeformat natalian.setup
98         timeformat => '%Y-%m-%d',
99
100 > Also, the [[plugins/relativedate]] plugin needs to be updated to 
101 > support relatatizing the contents of time elements. --[[Joey]] 
102
103 > Done and done; in html5 mode it uses the time tag, and even 
104 > adds pubdate when displaying ctimes. --[[Joey]]
105
106 ## tidy plugin
107
108 Will reformat html5 to html4.
109
110 ----
111
112
113 Ok, I consider this [[done]], at least as a first pass. Html5 mode
114 is experimental, but complete enough. --[[Joey]]