* Add wikitext markup plugin, which supports ".wiki" pages written in the
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Fri, 7 Jul 2006 18:28:27 +0000 (18:28 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Fri, 7 Jul 2006 18:28:27 +0000 (18:28 +0000)
  original wiki syntax, CamelCase links and all.

IkiWiki/Plugin/wikitext.pm [new file with mode: 0644]
debian/changelog
doc/features.mdwn
doc/ikiwiki.setup
doc/install.mdwn
doc/plugins/wikitext.mdwn [new file with mode: 0644]

diff --git a/IkiWiki/Plugin/wikitext.pm b/IkiWiki/Plugin/wikitext.pm
new file mode 100644 (file)
index 0000000..310b867
--- /dev/null
@@ -0,0 +1,30 @@
+#!/usr/bin/perl
+# WikiText markup
+package IkiWiki::Plugin::wikitext;
+
+use warnings;
+use strict;
+use Text::WikiFormat;
+
+sub import { #{{{
+       IkiWiki::hook(type => "filter", id => "wiki", call => \&filter);
+       IkiWiki::hook(type => "htmlize", id => "wiki", call => \&htmlize);
+} # }}}
+
+sub filter (@) { #{{{
+       my %params=@_;
+
+       # Make CamelCase links work by promoting them to fullfledged
+       # WikiLinks. This regexp is based on the one in Text::WikiFormat.
+       $params{content}=~s#(?<![["/>=])\b((?:[A-Z][a-z0-9]\w*){2,})#[[$1]]#g;
+
+       return $params{content};
+} #}}}
+
+sub htmlize ($) { #{{{
+       my $content = shift;
+
+       return Text::WikiFormat::format($content, undef, { implicit_links => 0 });
+} # }}}
+
+1
index 6b7c1a6796970be2f84ee54ce110cb6565cb70e4..3cea775be46830403f0be79c4d5122a9aea5ed0a 100644 (file)
@@ -4,8 +4,10 @@ ikiwiki (1.9) UNRELEASED; urgency=low
   * Patch from Faidon to use svn --limit when possible for recentchanges,
     speeds up recentchanges a lot for wikis with more history.
   * Patch from Recai to fix utf8 issues in git backend.
+  * Add wikitext markup plugin, which supports ".wiki" pages written in the
+    original wiki syntax, CamelCase links and all.
 
- -- Joey Hess <joeyh@debian.org>  Wed,  5 Jul 2006 16:53:34 -0400
+ -- Joey Hess <joeyh@debian.org>  Fri,  7 Jul 2006 14:11:50 -0400
 
 ikiwiki (1.8) unstable; urgency=low
 
index c22d2be91c0590c73fc8a5bbdf551538269f6fe3..5152beffd07b5039d236477ee967e989657c7ef4 100644 (file)
@@ -23,11 +23,12 @@ Some of ikiwiki's features:
   page with a filename ending in ".mdwn" is converted from markdown to html
   by ikiwiki. Markdown understands text formatted as it would be in an email,
   and is quite smart about converting it to html. The only additional markup
-  provided by ikiwiki aside from regular markdown is the [[WikiLink]] and 
+  provided by ikiwiki on top of regular markdown is the [[WikiLink]] and 
   [[PreprocessorDirective]]
 
   If you prefer to use some other markup language, ikiwiki allows others to
-  be added by [[plugins]].
+  easily be added by [[plugins]]. For example it also supports traditional
+  [[plugins/WikiText]] formatted pages.
 
 * support for other file types
 
index 9713d553b68f8d451eca29d90440379ac61983b3..8bc0e333609b5a0888fb518ea2acde215c33bb17 100644 (file)
@@ -71,7 +71,7 @@ use IkiWiki::Setup::Standard {
        #timeformat => '%c',
        
        # To add plugins, list them here.
-       #add_plugins => [qw{pagecount brokenlinks search smiley}],
+       #add_plugins => [qw{pagecount brokenlinks search smiley wikitext}],
        # If you want to disable any of the default plugins, list them here.
        #disable_plugins => [qw{inline htmlscrubber}],
 }
index f65e1a227fd642d21b9473e7f6eafd8b8452ced4..d23c88e419e3ebabb0b94870007185eb37344196 100644 (file)
@@ -6,7 +6,8 @@ perl modules if available: `CGI::Session` `CGI::FormBuilder` (version
 `Date::Parse` (libtimedate-perl), `HTML::Scrubber`, `RPC::XML`,
 `XML::Simple`
 
-If you want to install from the tarball, you should make sure that the required perl modules are installed, then run:
+If you want to install from the tarball, you should make sure that the
+required perl modules are installed, then run:
 
         perl Makefile.PL
         make
diff --git a/doc/plugins/wikitext.mdwn b/doc/plugins/wikitext.mdwn
new file mode 100644 (file)
index 0000000..5c5383f
--- /dev/null
@@ -0,0 +1,21 @@
+This plugin allows ikiwiki to process pages written in the original wiki
+text format. To use it, you need to have the Text::WikiFormat perl module
+installed, enable the plugin, then files with the extention `.wiki` will be
+processed as wiki text.
+
+Wiki formatting is very simple. An item wrapped in three single quotes is
+strong. An item wrapped in two single quotes is emphasized. Any word with
+multiple CapitalLetters (e. g., StudlyCaps) will become a link (standard
+[[WikiLinks|WikiLink]] work too). Four or more
+hyphen characters at the start of a line create a horizontal line.
+Newlines turn into the appropriate tags. Headers are matching equals signs
+around the header text -- the more signs, the lesser the header.
+
+Lists are indented text, by one tab or four spaces. In unordered lists,
+where each item has its own bullet point, each item needs a leading
+asterisk and space. Ordered lists consist of items marked with combination
+of one or more alphanumeric characters followed by a period and an optional
+space. Any indented text without either marking is code, handled literally.
+You can nest lists.
+
+This plugin is included in ikiwiki, but is not enabled by default.