* htmltidy plugin from Faidon.
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sat, 29 Jul 2006 20:50:20 +0000 (20:50 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sat, 29 Jul 2006 20:50:20 +0000 (20:50 +0000)
IkiWiki/Plugin/htmltidy.pm [new file with mode: 0644]
debian/changelog
debian/control
doc/ikiwiki.setup
doc/patchqueue/html_tidy_plugin.mdwn [deleted file]
doc/plugins/htmltidy.mdwn [new file with mode: 0644]

diff --git a/IkiWiki/Plugin/htmltidy.pm b/IkiWiki/Plugin/htmltidy.pm
new file mode 100644 (file)
index 0000000..ad405dc
--- /dev/null
@@ -0,0 +1,32 @@
+#!/usr/bin/perl
+# HTML Tidy plugin
+# requires 'tidy' binary, found in Debian or http://tidy.sf.net/
+# mostly a proof-of-concept on how to use external filters.
+# It is particularly useful when the html plugin is used.
+#
+# by Faidon Liambotis
+package IkiWiki::Plugin::tidy;
+
+use warnings;
+use strict;
+use IkiWiki;
+use IPC::Open2;
+
+sub import { #{{{
+       IkiWiki::hook(type => "sanitize", id => "tidy", call => \&sanitize);
+} # }}}
+
+sub sanitize ($) { #{{{
+       open2(*IN, *OUT, 'tidy -quiet -xml -indent -utf8') or return shift;
+       # open2 doesn't respect "use open ':utf8'"
+       binmode (IN, ':utf8'); 
+       binmode (OUT, ':utf8'); 
+
+       print OUT shift;
+       close OUT;
+
+       local $/ = undef;
+       return <IN>;
+} # }}}
+
+1
index f4f0cffab21565db426440440e9b8791e570b612..6ee1e7b146d6f79af8628bc18b62fca1ebe6e75e 100644 (file)
@@ -10,8 +10,9 @@ ikiwiki (1.13) UNRELEASED; urgency=low
     other gunk from the display, much nicer. You may want to rebuild your wiki
     when upgrading to get the cleanup globally.
   * Polygen plugin from Enrico.
+  * htmltidy plugin from Faidon.
 
- -- Joey Hess <joeyh@debian.org>  Sat, 29 Jul 2006 14:22:18 -0400
+ -- Joey Hess <joeyh@debian.org>  Sat, 29 Jul 2006 16:43:50 -0400
 
 ikiwiki (1.12) unstable; urgency=low
 
index 19cdddf8eda65a71d99e3e2f220637f0e5889b1f..aa8b3fa2403d42591b389d0740b674123c5ec8f2 100644 (file)
@@ -10,7 +10,7 @@ Package: ikiwiki
 Architecture: all
 Depends: ${perl:Depends}, libxml-simple-perl, markdown, libtimedate-perl, libhtml-template-perl, libhtml-scrubber-perl, libcgi-formbuilder-perl (>= 3.02.02), libtime-duration-perl, libcgi-session-perl, libmail-sendmail-perl, gcc | c-compiler, libc6-dev | libc-dev
 Recommends: subversion | git-core, hyperestraier
-Suggests: viewcvs, librpc-xml-perl, libtext-wikiformat-perl
+Suggests: viewcvs, librpc-xml-perl, libtext-wikiformat-perl, polygen, tidy
 Description: a wiki compiler
  ikiwiki converts a directory full of wiki pages into html pages suitable
  for publishing on a website. Unlike many wikis, ikiwiki does not have its
index b52f1ad39a01a8c6b1f14048c0ef080e6249c94e..9310a455668a9b24d5710118302d6839c00a36b1 100644 (file)
@@ -75,7 +75,7 @@ use IkiWiki::Setup::Standard {
        
        # To add plugins, list them here.
        #add_plugins => [qw{meta tag pagecount brokenlinks search smiley
-       #                   wikitext camelcase pagestats}],
+       #                   wikitext camelcase pagestats htmltidy}],
        # If you want to disable any of the default plugins, list them here.
        #disable_plugins => [qw{inline htmlscrubber}],
 }
diff --git a/doc/patchqueue/html_tidy_plugin.mdwn b/doc/patchqueue/html_tidy_plugin.mdwn
deleted file mode 100644 (file)
index a8b9f27..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-Obvious and straightforward ;-)
-tidy should be probably added to Suggests -- doc/ikiwiki.setup should also be updated.  
-(yes, I'm too lazy today...)
-
--- [[Faidon]]
-
----
-
-       #!/usr/bin/perl
-       # HTML Tidy plugin
-       # requires 'tidy' binary, found in Debian or http://tidy.sf.net/
-       # mostly a proof-of-concept on how to use external filters.
-       # It is particularly useful when the html plugin is used.
-       package IkiWiki::Plugin::tidy;
-       
-       use warnings;
-       use strict;
-       use IkiWiki;
-       use IPC::Open2;
-       
-       sub import { #{{{
-               IkiWiki::hook(type => "sanitize", id => "tidy", call => \&sanitize);
-       } # }}}
-       
-       sub sanitize ($) { #{{{
-               open2(*IN, *OUT, 'tidy -quiet -xml -indent -utf8') or return shift;
-               # open2 doesn't respect "use open ':utf8'"
-               binmode (IN, ':utf8'); 
-               binmode (OUT, ':utf8'); 
-       
-               print OUT shift;
-               close OUT;
-       
-               local $/ = undef;
-               return <IN>;
-       } # }}}
-       
-       1
\ No newline at end of file
diff --git a/doc/plugins/htmltidy.mdwn b/doc/plugins/htmltidy.mdwn
new file mode 100644 (file)
index 0000000..2c6f7b7
--- /dev/null
@@ -0,0 +1,5 @@
+This plugin uses [tidy](http://tidy.sourceforge.net/) to tidy up the html
+emitted by ikiwiki. Besides being nicely formatted, this helps ensure that
+even if users enter suboptimal html, your wiki generates 100% valid html.
+
+This plugin is included in ikiwiki, but is not enabled by default.