]> sipb.mit.edu Git - ikiwiki.git/blob - doc/bugs/html5_support.mdwn
bug
[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 > * 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
41 >   approach.
42
43 > --[[Joey]] 
44
45 # htmlscrubber.pm needs to not scrub new HTML5 elements
46
47 * [new elements](http://www.w3.org/TR/html5-diff/#new-elements)
48
49 > Many added now.
50 >
51 > Things I left out, too hard to understand today:
52 > Attributes contenteditable,
53 > data-\*, draggable, role, aria-\*.
54 > Tags command, keygen, output.
55
56 > Clearly unsafe: embed.
57
58 > Apparently cannot be used w/o javascript: menu.
59
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.
63 >  --[[Joey]] 
64
65 # HTML5 Validation and t/html.t
66
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.
72
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).
76
77 > Validation in the test suite is nice, but I am willing to lose those
78 > tests for a while. --[[Joey]] 
79
80 # HTML5 migration issues
81
82 # [article](http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#the-article-element) element
83
84 This element is poorly supported by browsers. As a workaround, `style.css` needs:
85
86         article {
87                 display: block;
88         }
89
90 Internet Explorer will display it as a block, though you can't seem to be able to further control the style.
91
92 > done  (needed for header too) --[[Joey]] 
93
94 ## Time element
95
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).
97
98 As a workaround:
99
100         au:~% grep timeformat natalian.setup
101         timeformat => '%Y-%m-%d',
102
103 > Also, the [[plugins/relativedate]] plugin needs to be updated to 
104 > support relatatizing the contents of time elements. --[[Joey]] 
105
106 > Done and done; in html5 mode it uses the time tag, and even 
107 > adds pubdate when displaying ctimes. --[[Joey]]
108
109 ## tidy plugin
110
111 Will reformat html5 to html4.
112
113 ----
114
115
116 Ok, I consider this [[done]], at least as a first pass. Html5 mode
117 is experimental, but complete enough. --[[Joey]]