html5 option

* Ikiwiki can be configured to generate html5 instead of the default xhtml
  1.0. The html5 output mode is experimental, not yet fully standards
  compliant, and will be subject to rapid change.
master
Joey Hess 2010-05-01 20:40:31 -04:00
parent ccafb10007
commit a547d26858
7 changed files with 29 additions and 8 deletions

View File

@ -234,6 +234,13 @@ sub getsetup () {
safe => 1,
rebuild => 1,
},
html5 => {
type => "boolean",
default => 0,
description => "generate HTML5? (experimental)",
safe => 1,
rebuild => 1,
},
sslcookie => {
type => "boolean",
default => 0,
@ -1725,6 +1732,7 @@ sub misctemplate ($$;@) {
wikiname => $config{wikiname},
pagebody => $pagebody,
baseurl => baseurl(),
html5 => $config{html5},
@_,
);
run_hooks(pagetemplate => sub {

View File

@ -138,6 +138,7 @@ sub genpage ($$) {
mtime => displaytime($pagemtime{$page}),
ctime => displaytime($pagectime{$page}),
baseurl => baseurl($page),
html5 => $config{html5},
);
run_hooks(pagetemplate => sub {

5
debian/changelog vendored
View File

@ -1,10 +1,12 @@
ikiwiki (3.20100428) UNRELEASED; urgency=low
* template: Fix typo.
* TMPL_INCLUDE re-enabled for templates read from the templatedir.
(But not in-wiki templates.)
* Version dependency on liburi-perl to >= 1.36; previous versions
did not support building urls from utf-8 strings. Closes: #579713
* Ikiwiki can be configured to generate html5 instead of the default xhtml
1.0. The html5 output mode is experimental, not yet fully standards
compliant, and will be subject to rapid change.
* htmlscrubber: Allow html5 semantic tags: section, nav, article, aside
hgroup, header, footer, figure, figcaption, time, mark
* htmlscrubber: Also allow some other html5 tags: canvas, progress, meter,
@ -16,6 +18,7 @@ ikiwiki (3.20100428) UNRELEASED; urgency=low
and form. (Also the form* override attributes for input and buttons.)
* htmlscrubber: Allow additional misc html5 attributes: reversed,
spellcheck, and hidden.
* template: Fix typo.
-- Joey Hess <joeyh@debian.org> Tue, 27 Apr 2010 12:10:51 -0400

View File

@ -20,13 +20,14 @@ HTML5](http://www.w3.org/TR/html5-diff/).
> What has been done so far, can be extended. Basically works
> in browsers, if you don't care about standards. A good prerequisite
> for anything else, anyway.
> 2. Switch to html5 in eg, ikiwiki 4; users have to deal with
> 2. Have both a html5 and a xhtml mode, allow user to select.
> 3. Switch to html5 in eg, ikiwiki 4; users have to deal with
> any custom markup on their pages/templates that breaks then.
> 3. Have both a html5 and a xhtml mode, allow user to select.
>
> The third option seems fairly tractable from what I see here and in
>
> The second option seems fairly tractable from what I see here and in
> your branch. You made only relatively minor changes to 10 templates.
> It would probably not be too dreadful to put them in ifdefs.
> It would probably not be too dreadful to put them in ifdefs. I've made a
> small start at doing that.
>
> Some of your changes are obvious, like using the new `time` and
> and `article` elements. Others less so, and I'm particularly
@ -70,6 +71,7 @@ HTML5](http://www.w3.org/TR/html5-diff/).
> [[this_todo|Add_label_to_search_form_input_field]]
> * Use details tag instead of the javascript in the toggle plugin.
> (Need to wait on browser support probably.)
>
> --[[Joey]]
# htmlscrubber.pm needs to not scrub new HTML5 elements

View File

@ -80,6 +80,7 @@ Probably incomplete list:
* YADA format setup files per default?
* Enable tagbase by default (so that tag autocreation will work by default).
Note that this is already done for wikis created by `auto-blog.setup`.
* html5 on by default (some day..)
In general, we try to use [[ikiwiki-transition]] or forced rebuilds on
upgrade to deal with changes that break compatability. Some things that

View File

@ -1,6 +1,9 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<TMPL_IF HTML5><!DOCTYPE html>
<html>
<TMPL_ELSE><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
</TMPL_IF>
<head>
<TMPL_IF NAME="FORCEBASEURL">
<base href="<TMPL_VAR FORCEBASEURL>" />

View File

@ -1,6 +1,9 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<TMPL_IF HTML5><!DOCTYPE html>
<html>
<TMPL_ELSE><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
</TMPL_IF>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Cache-Control" content="must-revalidate" />