* Add wikitext markup plugin, which supports ".wiki" pages written in the

original wiki syntax, CamelCase links and all.
master
joey 2006-07-07 18:28:27 +00:00
parent 723ebda476
commit 0f22d66c96
6 changed files with 60 additions and 5 deletions

View File

@ -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

4
debian/changelog vendored
View File

@ -4,8 +4,10 @@ ikiwiki (1.9) UNRELEASED; urgency=low
* Patch from Faidon to use svn --limit when possible for recentchanges, * Patch from Faidon to use svn --limit when possible for recentchanges,
speeds up recentchanges a lot for wikis with more history. speeds up recentchanges a lot for wikis with more history.
* Patch from Recai to fix utf8 issues in git backend. * 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 ikiwiki (1.8) unstable; urgency=low

View File

@ -23,11 +23,12 @@ Some of ikiwiki's features:
page with a filename ending in ".mdwn" is converted from markdown to html 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, 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 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]] [[PreprocessorDirective]]
If you prefer to use some other markup language, ikiwiki allows others to 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 * support for other file types

View File

@ -71,7 +71,7 @@ use IkiWiki::Setup::Standard {
#timeformat => '%c', #timeformat => '%c',
# To add plugins, list them here. # 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. # If you want to disable any of the default plugins, list them here.
#disable_plugins => [qw{inline htmlscrubber}], #disable_plugins => [qw{inline htmlscrubber}],
} }

View File

@ -6,7 +6,8 @@ perl modules if available: `CGI::Session` `CGI::FormBuilder` (version
`Date::Parse` (libtimedate-perl), `HTML::Scrubber`, `RPC::XML`, `Date::Parse` (libtimedate-perl), `HTML::Scrubber`, `RPC::XML`,
`XML::Simple` `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 perl Makefile.PL
make make

View File

@ -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.