From a547d2685866898665fad221939b0b820a42a088 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 1 May 2010 20:40:31 -0400 Subject: [PATCH] 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. --- IkiWiki.pm | 8 ++++++++ IkiWiki/Render.pm | 1 + debian/changelog | 5 ++++- doc/bugs/html5_support.mdwn | 12 +++++++----- doc/roadmap.mdwn | 1 + templates/misc.tmpl | 5 ++++- templates/page.tmpl | 5 ++++- 7 files changed, 29 insertions(+), 8 deletions(-) diff --git a/IkiWiki.pm b/IkiWiki.pm index 5ff1a5ae6..1e11d34e2 100644 --- a/IkiWiki.pm +++ b/IkiWiki.pm @@ -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 { diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 7e3d78861..5923f5e74 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -138,6 +138,7 @@ sub genpage ($$) { mtime => displaytime($pagemtime{$page}), ctime => displaytime($pagectime{$page}), baseurl => baseurl($page), + html5 => $config{html5}, ); run_hooks(pagetemplate => sub { diff --git a/debian/changelog b/debian/changelog index 8bf6f89b6..fc5a6124b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Tue, 27 Apr 2010 12:10:51 -0400 diff --git a/doc/bugs/html5_support.mdwn b/doc/bugs/html5_support.mdwn index 2d27ac803..bf782a3bf 100644 --- a/doc/bugs/html5_support.mdwn +++ b/doc/bugs/html5_support.mdwn @@ -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 diff --git a/doc/roadmap.mdwn b/doc/roadmap.mdwn index c126fd585..4b5f01c45 100644 --- a/doc/roadmap.mdwn +++ b/doc/roadmap.mdwn @@ -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 diff --git a/templates/misc.tmpl b/templates/misc.tmpl index 535a6f06b..0b7fefa08 100644 --- a/templates/misc.tmpl +++ b/templates/misc.tmpl @@ -1,6 +1,9 @@ - + + + diff --git a/templates/page.tmpl b/templates/page.tmpl index 7e850a56b..661d4a515 100644 --- a/templates/page.tmpl +++ b/templates/page.tmpl @@ -1,6 +1,9 @@ - + + + -- 2.32.0.93.g670b81a890