]> sipb.mit.edu Git - ikiwiki.git/blob - doc/bugs/html5_support.mdwn
5d2a413036f99a297a24a41cec8f00f9c9a48820
[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. Switch to html5 in eg, ikiwiki 4; users have to deal with
24 >    any custom markup on their pages/templates that breaks then.
25 > 3. Have both a html5 and a xhtml mode, allow user to select.
26 >
27 > The third 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.
30
31 > Some of your changes are obvious, like using the new `time` and
32 > and `article` elements. Others less so, and I'm particularly
33 > puzzled by these:
34
35 > * Removing the value="Submit" from the button on the 
36 >   commentmoderation form.
37 > * Removing feedlink.tmpl. What?!
38 > * Using a `h2` for the header of inlinepage.tmpl and page.tmpl, rather
39 >   than the styled span. Ikiwiki has
40 >   [[a_reason|todo/Option_to_make_title_an_h1?]] for not
41 >   using real `hN` for the header atop a page and here.
42 >   AFAICS, html5 does not invalidate that.
43 > * Removing Editurl from inlinepage.tmpl actions. I assume 
44 >   this is your own preference, needs to be removed from branch
45 >   before I can use it.
46 > * Removing the pageheader, content, and footer divs
47 >   which are all used by style.css.
48 >   Perhaps, the style sheet needs to be updated to use
49 >   the new elements, like the `footer` and `header`.
50 > * Removal of the favicon from page.tmpl. Surely html5 supports?
51 > * Removal of BASEURL from page.tmpl, apparently a mistake.
52 > * Removal of the `/` between wiki title and page title.
53 >   Personal preference.
54 > * Removal of `comments` div, which is there to be styled.
55 > * Why use a `p` rather than the `div` for `addcomments`?
56 > * Moving the action bar to the bottom of the page.
57 >   Personal preference.
58 > * Clearly searchquery.tmpl has no business using bad old `center`
59 >   tag, but something should still be done to replace it.
60
61 > (BTW, it would be helpful if you could re-merge master into your branch
62 > as it is a bit diverged now.) --[[Joey]] 
63
64 # htmlscrubber.pm needs to not scrub new HTML5 elements
65
66 * [new elements](http://www.w3.org/TR/html5-diff/#new-elements)
67
68 > Most of these can be supported trivially, since they are just semantic
69 > markup. Make a list of these, and their attributes (and which attributes
70 > can contain urls or other javascript injection mechanisms), and I can add
71 > them. Others, like `embed`, and `canvas` are *scary*. --[[Joey]]
72
73 # HTML5 Validation and t/html.t
74
75 [validator.nu](http://validator.nu/) is the authorative HTML5 validator,
76 however it is almost impossible to sanely introduce as a build dependency
77 because of its insane Java requirements. :( I test locally via
78 [cURL](http://wiki.whatwg.org/wiki/IDE), though Debian packages cannot be built
79 with a network dependency.
80
81 In the future, hopefully ikiwiki can test for valid HTML5 using [Relax NG
82 schema](http://syntax.whattf.org/) using a Debian package tool
83 [rnv](http://packages.qa.debian.org/r/rnv.html).
84
85 > Validation in the test suite is nice, but I am willing to lose those
86 > tests for a while. --[[Joey]] 
87
88 # HTML5 migration issues
89
90 # [article](http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html#the-article-element) element
91
92 This element is poorly supported by browsers. As a workaround, `style.css` needs:
93
94         article {
95                 display: block;
96         }
97
98 Internet Explorer will display it as a block, though you can't seem to be able to further control the style.
99
100 ## Time element
101
102 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).
103
104 As a workaround:
105
106         au:~% grep timeformat natalian.setup
107         timeformat => '%Y-%m-%d',
108
109 > Also, the [[plugins/relativedate]] plugin needs to be updated to 
110 > support relatatizing the contents of time elements. --[[Joey]]