* Add first draft at a Restructured Text (rst) plugin, by Sergio
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sat, 19 Aug 2006 05:05:02 +0000 (05:05 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Sat, 19 Aug 2006 05:05:02 +0000 (05:05 +0000)
  Talens-Oliag. Note that this has many known issues -- see the caveats on
  the plugin's page.
* Credit everyone who wrote a plugin on the plugins' wiki pages.

13 files changed:
IkiWiki/Plugin/map.pm
IkiWiki/Plugin/pagestats.pm
IkiWiki/Plugin/rst.pm [new file with mode: 0644]
debian/changelog
doc/ikiwiki.setup
doc/patchqueue/rst.mdwn [deleted file]
doc/plugins/htmltidy.mdwn
doc/plugins/map.mdwn
doc/plugins/pagestats.mdwn
doc/plugins/polygen.mdwn
doc/plugins/rst.mdwn [new file with mode: 0644]
doc/plugins/sidebar.mdwn
doc/roadmap.mdwn

index 070f49415d14edffc262d34b4c03d39568c3738b..0ae5c1002f11b6f44ef38100c1d70d926421ef61 100644 (file)
@@ -2,7 +2,7 @@
 #
 # Produce a hyerarchical map of links.
 #
-# By Alessandro Dotti Contra <alessandro@hyboria.org>
+# by Alessandro Dotti Contra <alessandro@hyboria.org>
 #
 # Revision: 0.2
 package IkiWiki::Plugin::map;
index de559e2c5a63c762eb3277a85efffb950c912793..8ce563fc5ac489260db3122dc842621a8a51ae8b 100644 (file)
@@ -7,7 +7,7 @@
 #          (default)
 #   table: produces a table with the number of backlinks for each page
 #
-# By Enrico Zini.
+# by Enrico Zini
 package IkiWiki::Plugin::pagestats;
 
 use warnings;
diff --git a/IkiWiki/Plugin/rst.pm b/IkiWiki/Plugin/rst.pm
new file mode 100644 (file)
index 0000000..6bf11fe
--- /dev/null
@@ -0,0 +1,69 @@
+#!/usr/bin/perl
+# Very simple reStructuredText processor.
+#
+# This plugin calls python and requires python-docutils to transform the text
+# into html.
+#
+# Its main problem is that it does not support ikiwiki's WikiLinks nor
+# Preprocessor Directives.
+#
+# Probably Wikilinks and Preprocessor Directives should support a list of
+# extensions to process (i.e. the linkify function could be transformed into
+# reStructuredText instead of HTML using a hook on rst.py instead of the
+# current linkify function)
+#
+# by Sergio Talens-Oliag <sto@debian.org>
+
+package IkiWiki::Plugin::rst;
+
+use warnings;
+use strict;
+use IkiWiki;
+use IPC::Open2;
+
+# Simple python script, maybe it should be implemented using an external script.
+# The settings_overrides are given to avoid potential security risks when
+# reading external files or if raw html is included on rst pages.
+my $pyCmnd = "
+from docutils.core import publish_string;
+from sys import stdin;
+html = publish_string(stdin.read(), writer_name='html', 
+       settings_overrides = { 'halt_level': 6, 
+                              'file_insertion_enabled': 0,
+                              'raw_enabled': 0 }
+);
+print html[html.find('<body>')+6:html.find('</body>')].strip();
+";
+
+sub import { #{{{
+       IkiWiki::hook(type => "htmlize", id => "rst", call => \&htmlize);
+} # }}}
+
+sub htmlize ($) { #{{{
+       my $content=shift;
+
+       my $tries=10;
+       while (1) {
+               eval {
+                       # Try to call python and run our command
+                       open2(*IN, *OUT, "python", "-c",  $pyCmnd)
+                               or return $content;
+               };
+               last unless $@;
+               $tries--;
+               if ($tries < 1) {
+                       IkiWiki::debug("failed to run python to convert rst: $@");
+                       return $content;
+               }
+       }
+       # open2 doesn't respect "use open ':utf8'"
+       binmode (IN, ':utf8');
+       binmode (OUT, ':utf8');
+       
+       print OUT $content;
+       close OUT;
+       local $/ = undef;
+       return <IN>;
+} # }}}
+
+1
index 779147086d01d58b1192a8caaf25bd34cefb144e..61379c5fb5e864ccdb3f110cdcd36844ec73631c 100644 (file)
@@ -12,8 +12,12 @@ ikiwiki (1.21) UNRELEASED; urgency=low
   * Add a map plugin contributed by Alessandro Dotti Contra.
   * Add otl format plugin, which handles files as created by vimoutliner.
   * Fix ikiwiki-mass-rebuild to work in the way the postinst uses it.
+  * Add first draft at a Restructured Text (rst) plugin, by Sergio
+    Talens-Oliag. Note that this has many known issues -- see the caveats on
+    the plugin's page.
+  * Credit everyone who wrote a plugin on the plugins' wiki pages.
 
- -- Joey Hess <joeyh@debian.org>  Fri, 18 Aug 2006 22:54:08 -0400
+ -- Joey Hess <joeyh@debian.org>  Sat, 19 Aug 2006 00:56:32 -0400
 
 ikiwiki (1.20) unstable; urgency=low
 
index 678dece2359066e05e9311c7231cd245cd4a75eb..bf1aa3703a41d8d48f1a66a98e849929947d5664 100644 (file)
@@ -81,7 +81,7 @@ use IkiWiki::Setup::Standard {
        # To add plugins, list them here.
        #add_plugins => [qw{meta tag pagecount brokenlinks search smiley
        #                   wikitext camelcase pagestats htmltidy fortune
-       #                   sidebar map}],
+       #                   sidebar map rst}],
        # If you want to disable any of the default plugins, list them here.
        #disable_plugins => [qw{inline htmlscrubber}],
 }
diff --git a/doc/patchqueue/rst.mdwn b/doc/patchqueue/rst.mdwn
deleted file mode 100644 (file)
index c279099..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-This is a whole lot better than nothing, but it's a shame it forks python
-every page. Anyone want to get [this](http://search.cpan.org/~nodine/Text-Restructured-0.003016/) into Debian and use it instead?
---[[Joey]]
-
-Actually, if someone adds support for it to ikiwiki, I would be glad to get
-the package into Debian myself --[[Joey]]
-
-       #!/usr/bin/perl
-       # Very simple reStructuredText processor.
-       #
-       # This plugin calls python and requires python-docutils to transform the text
-       # into html.
-       #
-       # It's main problem is that it does not support ikiwiki's WikiLinks nor
-       # Preprocessor Directives (in fact the same problem applies to the current
-       # Wikitext processor, although in that case the output looks less worse ;)
-       #
-       # Probably Wikilinks and Preprocessor Directives should support a list of
-       # extensions to process (i.e. the linkify function could be transformed into
-       # reStructuredText instead of HTML using a hook on rst.py instead of the
-       # current linkify function)
-       #
-       # by Sergio Talens-Oliag <sto@debian.org>
-       
-       package IkiWiki::Plugin::rst;
-       
-       use warnings;
-       use strict;
-       use IkiWiki;
-       use IPC::Open2;
-       
-       # Simple python script, maybe it should be implemented using an external script.
-       # The settings_overrides are given to avoid potential security risks when
-       # reading external files or if raw html is included on rst pages.
-       my $pyCmnd = "
-       from docutils.core import publish_string;
-       from sys import stdin;
-       html = publish_string(stdin.read(), writer_name='html', 
-              settings_overrides = { 'halt_level': 6, 
-                                     'file_insertion_enabled': 0,
-                                     'raw_enabled': 0 }
-       );
-       print html[html.find('<body>')+6:html.find('</body>')].strip();
-       ";
-       
-       sub import { #{{{
-               IkiWiki::hook(type => "htmlize", id => "rst", call => \&htmlize);
-       } # }}}
-       
-       sub htmlize ($) { #{{{
-               my $content = shift;
-       
-               # Try to call python and run our command
-               open2(*IN, *OUT, "python", "-c",  "$pyCmnd") or return $content;
-       
-               # open2 doesn't respect "use open ':utf8'"
-               binmode (IN, ':utf8');
-               binmode (OUT, ':utf8');
-               
-               print OUT $content;
-               close OUT;
-               local $/ = undef;
-               return <IN>;
-       } # }}}
-       
-       1
index f6f6e0c1758aba060f4fe6236bbf433241305f00..9da9c4d98aeb1142ab9b21808062b25247795210 100644 (file)
@@ -3,5 +3,6 @@ emitted by ikiwiki. Besides being nicely formatted, this helps ensure that
 even if users enter suboptimal html, your wiki generates valid html.
 
 This plugin is included in ikiwiki, but is not enabled by default.
+It was contributed by Faidon Liambotis.
 
 [[tag type/html]]
index 40e284256a32fa019ec059aa262882c6df5b7e6b..cd2ef1bc5b762ae7ce693c5d3e561505bba02e14 100644 (file)
@@ -9,6 +9,7 @@ Hint: To limit the map to displaying pages less than a certian level deep,
 use a [[PageSpec]] like this: `pages="* and !*/*/*"`
 
 This plugin is included in ikiwiki, but is not enabled by default.
+It was contributed by Alessandro Dotti Contra.
 
 If this plugin is enabled, here is a page map for the plugins section
 of this wiki:
index a9f3bdbdb79a7c7d0770ca1e0a23c1a8cfc2892b..93e9f569487f8c735132b42698d53a4fab9a7e9b 100644 (file)
@@ -11,5 +11,6 @@ And here's how to create a table of all the pages on the wiki:
        \[[pagestats style="table"]]
 
 This plugin is included in ikiwiki, but is not enabled by default.
+It was contributed by Enrico Zini
 
 [[tag type/meta type/tags]]
index 85b05e102d4dfc706bac3b4611c11855e95096bb..d04708e2a26ec1e6abcd824b7f88e0413146784e 100644 (file)
@@ -7,6 +7,7 @@ It's also possible to specify a starting nonterminal for the grammar by
 including `symbol="text"` in the directive.
 
 This plugin is included in ikiwiki, but not enabled by default.
+It was contributed by Enrico Zini.
 
 ----
 
diff --git a/doc/plugins/rst.mdwn b/doc/plugins/rst.mdwn
new file mode 100644 (file)
index 0000000..0f0d6f9
--- /dev/null
@@ -0,0 +1,24 @@
+This plugin lets ikwiki convert files with names ending in ".rst" to html.
+It uses the [reStructuredText](http://docutils.sourceforge.net/rst.html)
+markup syntax. You need to have the python-docutils module installed to use
+it.
+
+Note that this plugin does not interoperate very well with the rest of
+ikiwiki. Limitations include:
+
+* reStructuredText does not allow raw html to be inserted into
+  documents, but ikiwiki does so in many cases, including
+  [[WikiLinks|WikiLink]] and many
+  [[PreprocessorDirectives|PreprocessorDirective]].
+* It's slow; it forks a copy of python for each page. While there is a
+  perl version of the reStructuredText processor, it is not being kept in
+  sync with the standard version, so is not used.
+
+So while you may find this useful for importing old files into your wiki,
+using this as your main markup language in ikiwiki isn't recommended at
+this time.
+
+This plugin is included in ikiwiki, but not enabled by default.
+It was contributed by Sergio Talens-Oliag.
+
+[[tag type/format]]
index f38e56817ce4c859cd12ffe4eaf923c84e9b3958..8ab416f6f8ac5f801bb1b44156308c817ea52a3e 100644 (file)
@@ -12,5 +12,6 @@ you can create a sidebar page that is completely empty. This will turn off
 the sidebar altogether.
 
 This plugin is included in ikiwiki, but is not enabled by default.
+It was contributed by Tuomo Valkonen.
 
 [[tag type/chrome]]
index 4ab0a7e59852e4b2fd7dcd6944cb80ec9a01e543..a645877fb583698dd6d0c5e4779f5af850dd4bbe 100644 (file)
@@ -25,6 +25,6 @@ Released 29 April 2006.
   quickly grow to support them all.. See [[about_rcs_backends]]
   _(status: supports git in tree)_
 * Support for one other markup language, probably restructured text.
-  _(status: done, but need a few more in tree)_
+  _(status: done, but the rst plugin needs improvement)_
 * No serious known [[bugs]]
 * No severe-to-moderate known [[security]] issues.