diff -Nru libpod-simple-wiki-perl-0.08/bin/pod2wiki libpod-simple-wiki-perl-0.11/bin/pod2wiki --- libpod-simple-wiki-perl-0.08/bin/pod2wiki 2007-02-01 15:39:52.000000000 +0000 +++ libpod-simple-wiki-perl-0.11/bin/pod2wiki 2009-08-27 03:06:58.000000000 +0100 @@ -75,6 +75,15 @@ --man full documentation +=head1 DESCRIPTION + +This program is used for converting Pod text to Wiki text. + +Pod is Perl's I format. See C or C. + +A Wiki is a user extensible web site. It uses very simple mark-up that is converted to Html. For an introduction to Wikis see: http://en.wikipedia.org/wiki/Wiki + + =head1 OPTIONS =over 4 @@ -95,27 +104,39 @@ =item wiki -This is the original Wiki format as used on Ward Cunningham's Portland repository of Patterns. The formatting rules are given at http://c2.com/cgi/wiki?TextFormattingRules +This is the original Wiki format as used on Ward Cunningham's Portland repository of Patterns. See http://c2.com/cgi/wiki =item kwiki -This is the format as used by Brian Ingerson's CGI::Kwiki: http://search.cpan.org/dist/CGI-Kwiki/ +This is the format as used by Brian Ingerson's Kwiki: http://www.kwiki.org =item usemod -This is the format used by the Usemod wikis. See: http://www.usemod.com/cgi-bin/wiki.pl?WikiFormat +This is the format used by the Usemod wikis. See: http://www.usemod.com/cgi-bin/wiki.pl =item twiki -This is the format used by TWiki wikis. See: http://www.twiki.org/ +This is the format used by TWiki wikis. See: http://twiki.org/ + +=item tiddlywiki + +This is the format used by the TiddlyWiki. See: http://www.tiddlywiki.com/ + +=item textile + +The Textile markup format as used on GitHub. See: http://textile.thresholdstate.com/ =item wikipedia or mediawiki -This is the format used by Wikipedia and MediaWiki wikis. See: http://www.wikipedia.org/ +This is the format used by Wikipedia and MediaWiki wikis. See: http://www.mediawiki.org/ =item moinmoin -This is the format used by MoinMoin wikis. See: http://moinmoin.wikiwikiweb.de/ +This is the format used by MoinMoin wikis. See: http://moinmo.in/MoinMoinWiki + +=item confluence + +This is the format used by Confluence. See: http://www.atlassian.com/software/confluence/ =back @@ -134,17 +155,23 @@ Prints the manual page and exits. - =back -=head1 DESCRIPTION -This program is used for converting Pod text to Wiki text. +=head1 DISCLAIMER OF WARRANTY -Pod is Perl's I format. See C or C. +Please refer to the DISCLAIMER OF WARRANTY in L. + + +=head1 AUTHOR + +John McNamara jmcnamara@cpan.org + + +=head1 COPYRIGHT -A Wiki is a user extensible web site. It uses very simple mark-up that is converted to Html. +© MMIII-MMVIII, John McNamara. -For an introduction to Wikis see: http://c2.com/cgi/wiki?WikiGettingStartedFaq and http://c2.com/cgi/wiki?WikiWikiWebFaq +All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself. =cut diff -Nru libpod-simple-wiki-perl-0.08/Changes libpod-simple-wiki-perl-0.11/Changes --- libpod-simple-wiki-perl-0.08/Changes 2007-08-25 17:58:21.000000000 +0100 +++ libpod-simple-wiki-perl-0.11/Changes 2009-08-29 14:47:48.000000000 +0100 @@ -1,5 +1,21 @@ Revision history for Pod::Simple::Wiki. +0.11 Aug 29 2009 + + ! Fix for literal newline in
 block in Textile filter.
+
+
+0.10 Aug 28 2009
+
+     + Added Textile support for github wikis.
+
+
+0.09 May 24 2008
+
+    + Added Confluence support.
+      Thanks to David Bartle, Andrew Hobbs and
+      Jim Renwick for patches.
+
 
 0.08 August 25 2007
 
diff -Nru libpod-simple-wiki-perl-0.08/debian/changelog libpod-simple-wiki-perl-0.11/debian/changelog
--- libpod-simple-wiki-perl-0.08/debian/changelog	2010-05-09 20:12:49.000000000 +0100
+++ libpod-simple-wiki-perl-0.11/debian/changelog	2010-05-09 20:12:49.000000000 +0100
@@ -1,3 +1,10 @@
+libpod-simple-wiki-perl (0.11-1) unstable; urgency=low
+
+  * New upstream release
+  * Fix debian/watch file
+
+ -- Ivan Kohler   Wed, 24 Mar 2010 17:35:50 -0700
+
 libpod-simple-wiki-perl (0.08-3) unstable; urgency=low
 
   * Update debian/rules to current dh-make-perl template to fix "unconditional
diff -Nru libpod-simple-wiki-perl-0.08/debian/watch libpod-simple-wiki-perl-0.11/debian/watch
--- libpod-simple-wiki-perl-0.08/debian/watch	2010-05-09 20:12:49.000000000 +0100
+++ libpod-simple-wiki-perl-0.11/debian/watch	2010-05-09 20:12:49.000000000 +0100
@@ -1,3 +1,2 @@
-# format version number, currently 3; this line is compulsory!
 version=3
-http://www.cpan.org/modules/by-module/Pod/Pod-Simple-Wiki-([\.\d]+)\.(?:tar\.gz|tar|tgz)
+http://search.cpan.org/dist/Pod-Simple-Wiki/   .*/Pod-Simple-Wiki-v?(\d[\d.-]+)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip)$
diff -Nru libpod-simple-wiki-perl-0.08/examples/pod2wiki.pl libpod-simple-wiki-perl-0.11/examples/pod2wiki.pl
--- libpod-simple-wiki-perl-0.08/examples/pod2wiki.pl	2007-02-01 15:39:52.000000000 +0000
+++ libpod-simple-wiki-perl-0.11/examples/pod2wiki.pl	2009-08-27 01:33:44.000000000 +0100
@@ -75,6 +75,15 @@
         --man        full documentation
 
 
+=head1 DESCRIPTION
+
+This program is used for converting Pod text to Wiki text.
+
+Pod is Perl's I format. See C or C.
+
+A Wiki is a user extensible web site. It uses very simple mark-up that is converted to Html. For an introduction to Wikis see: http://en.wikipedia.org/wiki/Wiki
+
+
 =head1 OPTIONS
 
 =over 4
@@ -95,27 +104,35 @@
 
 =item wiki
 
-This is the original Wiki format as used on Ward Cunningham's Portland repository of Patterns. The formatting rules are given at http://c2.com/cgi/wiki?TextFormattingRules
+This is the original Wiki format as used on Ward Cunningham's Portland repository of Patterns. See http://c2.com/cgi/wiki
 
 =item kwiki
 
-This is the format as used by Brian Ingerson's CGI::Kwiki: http://search.cpan.org/dist/CGI-Kwiki/
+This is the format as used by Brian Ingerson's Kwiki: http://www.kwiki.org
 
 =item usemod
 
-This is the format used by the Usemod wikis. See: http://www.usemod.com/cgi-bin/wiki.pl?WikiFormat
+This is the format used by the Usemod wikis. See: http://www.usemod.com/cgi-bin/wiki.pl
 
 =item twiki
 
-This is the format used by TWiki wikis.  See: http://www.twiki.org/
+This is the format used by TWiki wikis.  See: http://twiki.org/
+
+=item tiddlywiki
+
+This is the format used by the TiddlyWiki.  See: http://www.tiddlywiki.com/
 
 =item wikipedia or mediawiki
 
-This is the format used by Wikipedia and MediaWiki wikis.  See: http://www.wikipedia.org/
+This is the format used by Wikipedia and MediaWiki wikis.  See: http://www.mediawiki.org/
 
 =item moinmoin
 
-This is the format used by MoinMoin wikis.  See: http://moinmoin.wikiwikiweb.de/
+This is the format used by MoinMoin wikis.  See: http://moinmo.in/MoinMoinWiki
+
+=item confluence
+
+This is the format used by Confluence.  See: http://www.atlassian.com/software/confluence/
 
 =back
 
@@ -134,17 +151,23 @@
 
 Prints the manual page and exits.
 
-
 =back
 
-=head1 DESCRIPTION
 
-This program is used for converting Pod text to Wiki text.
+=head1 DISCLAIMER OF WARRANTY
 
-Pod is Perl's I format. See C or C.
+Please refer to the DISCLAIMER OF WARRANTY in L.
+
+
+=head1 AUTHOR
+
+John McNamara jmcnamara@cpan.org
+
+
+=head1 COPYRIGHT
 
-A Wiki is a user extensible web site. It uses very simple mark-up that is converted to Html.
+© MMIII-MMVIII, John McNamara.
 
-For an introduction to Wikis see: http://c2.com/cgi/wiki?WikiGettingStartedFaq and http://c2.com/cgi/wiki?WikiWikiWebFaq
+All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.
 
 =cut
diff -Nru libpod-simple-wiki-perl-0.08/lib/Pod/Simple/Wiki/Confluence.pm libpod-simple-wiki-perl-0.11/lib/Pod/Simple/Wiki/Confluence.pm
--- libpod-simple-wiki-perl-0.08/lib/Pod/Simple/Wiki/Confluence.pm	1970-01-01 01:00:00.000000000 +0100
+++ libpod-simple-wiki-perl-0.11/lib/Pod/Simple/Wiki/Confluence.pm	2009-08-27 01:33:44.000000000 +0100
@@ -0,0 +1,214 @@
+package Pod::Simple::Wiki::Confluence;
+
+###############################################################################
+#
+# Pod::Simple::Wiki::Confluence - A class for creating Pod to Confluence filters.
+#
+#
+# Copyright 2003-2008, John McNamara, jmcnamara@cpan.org
+#
+# Documentation after __END__
+#
+
+use Pod::Simple::Wiki;
+use strict;
+use vars qw(@ISA $VERSION);
+
+
+@ISA     = qw(Pod::Simple::Wiki);
+$VERSION = '0.09';
+
+###############################################################################
+#
+# The tag to wiki mappings.
+#
+my $tags = {
+            ''    => '*',
+            ''   => '*',
+            ''    => '_',
+            ''   => '_',
+            ''   => '{{',
+            ''  => '}}',
+            '
'  => "{noformat}\n",
+            '
' => "\n{noformat}\n", + + '

' => 'h1. ', + '

' => "\n\n", + '

' => 'h2. ', + '

' => "\n\n", + '

' => 'h3. ', + '

' => "\n\n", + '

' => 'h4. ', + '

' => "\n\n", + }; + +############################################################################### +# +# new() +# +# Simple constructor inheriting from Pod::Simple::Wiki. +# +sub new { + + my $class = shift; + my $self = Pod::Simple::Wiki->new('wiki', @_); + $self->{_tags} = $tags; + + bless $self, $class; + return $self; +} + +############################################################################### +# +# _indent_item() +# +# Indents an "over-item" to the correct level. +# +sub _indent_item { + + my $self = shift; + my $item_type = $_[0]; + my $item_param = $_[1]; + my $indent_level = $self->{_item_indent}; + + if ($item_type eq 'bullet') { + $self->_append('*' x $indent_level . ' '); + } + elsif ($item_type eq 'number') { + $self->_append('#' x $indent_level . ' '); + } + # Confluence doesn't have the equivalent of a
list so we use a + # bullet list with a bolded "item" as a workaround. + elsif ($item_type eq 'text') { + $self->_append('*' x $indent_level . ' *'); + } +} + +############################################################################### +# +# _handle_text() +# +# Perform any necessary transforms on the text. This is mainly used to escape +# inadvertent CamelCase words. +# +sub _handle_text { + + my $self = shift; + my $text = $_[0]; + + # Only escape words in paragraphs + if (not $self->{_in_Para}) { + $self->{_wiki_text} .= $text; + return; + } + + # Split the text into tokens but maintain the whitespace + my @tokens = split /(\s+)/, $text; + + # Escape any tokens here, if necessary. + + # Rejoin the tokens and whitespace. + $self->{_wiki_text} .= join '', @tokens; +} + + +############################################################################### +# +# Functions to deal with =over ... =back regions for +# +# Bulleted lists +# Numbered lists +# Text lists +# Block lists +# +sub _end_item_text {$_[0]->_output('* ')} + + +############################################################################### +# +# _start_Para() +# +# Special handling for paragraphs that are part of an "over" block. +# +sub _start_Para { + + my $self = shift; + my $indent_level = $self->{_item_indent}; + + if ($self->{_in_over_block}) { + $self->_append('bq. '); + } +} + + +1; + + +__END__ + + +=head1 NAME + +Pod::Simple::Wiki::Confluence - A class for creating Pod to Confluence wiki filters. + +=head1 SYNOPSIS + +This module isn't used directly. Instead it is called via C: + + #!/usr/bin/perl -w + + use strict; + use Pod::Simple::Wiki; + + + my $parser = Pod::Simple::Wiki->new('confluence'); + + ... + + +Convert Pod to a Confluence wiki format using the installed C utility: + + pod2wiki --style confluence file.pod > file.wiki + + +=head1 DESCRIPTION + +The C module is used for converting Pod text to Wiki text. + +Pod (Plain Old Documentation) is a simple markup language used for writing Perl documentation. + +For an introduction to Confluence see: http://www.atlassian.com/software/confluence/ + +This module isn't generally invoked directly. Instead it is called via C. See the L and L documentation for more information. + + +=head1 METHODS + +Pod::Simple::Wiki::Confluence inherits all of the methods of C and C. See L and L for more details. + + +=head1 SEE ALSO + +This module also installs a C command line utility. See C for details. + + +=head1 ACKNOWLEDGEMENTS + +Thanks to David Bartle, Andrew Hobbs and Jim Renwick for patches. + + +=head1 DISCLAIMER OF WARRANTY + +Please refer to the DISCLAIMER OF WARRANTY in L. + + +=head1 AUTHORS + +John McNamara jmcnamara@cpan.org + + +=head1 COPYRIGHT + +© MMIII-MMVIII, John McNamara. + +All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself. diff -Nru libpod-simple-wiki-perl-0.08/lib/Pod/Simple/Wiki/Kwiki.pm libpod-simple-wiki-perl-0.11/lib/Pod/Simple/Wiki/Kwiki.pm --- libpod-simple-wiki-perl-0.08/lib/Pod/Simple/Wiki/Kwiki.pm 2007-08-25 18:10:19.000000000 +0100 +++ libpod-simple-wiki-perl-0.11/lib/Pod/Simple/Wiki/Kwiki.pm 2009-08-27 01:33:44.000000000 +0100 @@ -5,7 +5,7 @@ # Pod::Simple::Wiki::Kwiki - A class for creating Pod to Kwiki filters. # # -# Copyright 2003-2007, John McNamara, jmcnamara@cpan.org +# Copyright 2003-2008, John McNamara, jmcnamara@cpan.org # # Documentation after __END__ # @@ -258,6 +258,6 @@ =head1 COPYRIGHT -© MMIII-MMVII, John McNamara. +© MMIII-MMVIII, John McNamara. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself. diff -Nru libpod-simple-wiki-perl-0.08/lib/Pod/Simple/Wiki/Mediawiki.pm libpod-simple-wiki-perl-0.11/lib/Pod/Simple/Wiki/Mediawiki.pm --- libpod-simple-wiki-perl-0.08/lib/Pod/Simple/Wiki/Mediawiki.pm 2007-08-25 18:10:20.000000000 +0100 +++ libpod-simple-wiki-perl-0.11/lib/Pod/Simple/Wiki/Mediawiki.pm 2009-08-27 01:33:44.000000000 +0100 @@ -5,7 +5,7 @@ # Pod::Simple::Wiki::Mediawiki - A class for creating Pod to Mediawiki filters. # # -# Copyright 2003-2007, John McNamara, jmcnamara@cpan.org +# Copyright 2003-2008, John McNamara, jmcnamara@cpan.org # # Documentation after __END__ # @@ -311,6 +311,6 @@ =head1 COPYRIGHT -© MMIII-MMVII, John McNamara. +© MMIII-MMVIII, John McNamara. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself. diff -Nru libpod-simple-wiki-perl-0.08/lib/Pod/Simple/Wiki/Moinmoin.pm libpod-simple-wiki-perl-0.11/lib/Pod/Simple/Wiki/Moinmoin.pm --- libpod-simple-wiki-perl-0.08/lib/Pod/Simple/Wiki/Moinmoin.pm 2007-08-25 18:10:20.000000000 +0100 +++ libpod-simple-wiki-perl-0.11/lib/Pod/Simple/Wiki/Moinmoin.pm 2009-08-27 01:33:44.000000000 +0100 @@ -5,7 +5,7 @@ # Pod::Simple::Wiki::Moinmoin - A class for creating Pod to Moinmoin filters. # # -# Copyright 2003-2007, John McNamara, jmcnamara@cpan.org +# Copyright 2003-2008, John McNamara, jmcnamara@cpan.org # # Documentation after __END__ # @@ -223,6 +223,6 @@ =head1 COPYRIGHT -© MMIII-MMVII, John McNamara. +© MMIII-MMVIII, John McNamara. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself. diff -Nru libpod-simple-wiki-perl-0.08/lib/Pod/Simple/Wiki/Template.pm libpod-simple-wiki-perl-0.11/lib/Pod/Simple/Wiki/Template.pm --- libpod-simple-wiki-perl-0.08/lib/Pod/Simple/Wiki/Template.pm 2007-08-25 18:10:20.000000000 +0100 +++ libpod-simple-wiki-perl-0.11/lib/Pod/Simple/Wiki/Template.pm 2009-08-28 20:25:07.000000000 +0100 @@ -19,7 +19,7 @@ # Pod::Simple::Wiki::Template - A class for creating Pod to Template filters. # # -# Copyright 2003-2007, John McNamara, jmcnamara@cpan.org +# Copyright 2003-2008, John McNamara, jmcnamara@cpan.org # # Documentation after __END__ # @@ -222,6 +222,8 @@ =head2 Portme Step 1 +Fork, clone or download the latest version of C from the github repository: http://github.com/jmcnamara/pod-simple-wiki/ + Copy the C to a new module C. The module name should have the first letter capitalised and all others lowercase, i.e, the same as returned by C. @@ -282,11 +284,9 @@ Remove or replace all C comments. - =head2 Portme Step 7 -Send it to me the tarred directory with libs and tests and I'll release it to CPAN. - +Send me a git pull request or the tarred directory with libs and tests and I'll release it to CPAN. =head1 METHODS @@ -322,6 +322,6 @@ =head1 COPYRIGHT -© MMIII-MMVII, John McNamara. +© MMIII-MMVIII, John McNamara. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself. diff -Nru libpod-simple-wiki-perl-0.08/lib/Pod/Simple/Wiki/Textile.pm libpod-simple-wiki-perl-0.11/lib/Pod/Simple/Wiki/Textile.pm --- libpod-simple-wiki-perl-0.08/lib/Pod/Simple/Wiki/Textile.pm 1970-01-01 01:00:00.000000000 +0100 +++ libpod-simple-wiki-perl-0.11/lib/Pod/Simple/Wiki/Textile.pm 2009-08-29 14:40:42.000000000 +0100 @@ -0,0 +1,210 @@ +package Pod::Simple::Wiki::Textile; + +############################################################################### +# +# Pod::Simple::Wiki::Textile - A class for creating Pod to Textile filters. +# +# +# Copyright 2003-2008, John McNamara, jmcnamara@cpan.org +# +# Documentation after __END__ +# + +use Pod::Simple::Wiki; +use strict; +use vars qw(@ISA $VERSION); + + +@ISA = qw(Pod::Simple::Wiki); +$VERSION = '0.08'; + +############################################################################### +# +# The tag to wiki mappings. +# +my $tags = { + '' => '*', + '' => '*', + '' => '_', + '' => '_', + '' => '@', + '' => '@', + '
'  => "
\n",
+            '
' => "\n
\n\n", + + '

' => 'h1. ', + '

' => "\n\n", + '

' => 'h2. ', + '

' => "\n\n", + '

' => 'h3. ', + '

' => "\n\n", + '

' => 'h4. ', + '

' => "\n\n", + }; + + +############################################################################### +# +# new() +# +# Simple constructor inheriting from Pod::Simple::Wiki. +# +sub new { + + my $class = shift; + my $self = Pod::Simple::Wiki->new('wiki', @_); + $self->{_tags} = $tags; + + bless $self, $class; + return $self; +} + + +############################################################################### +# +# _indent_item() +# +# Indents an "over-item" to the correct level. +# +sub _indent_item { + + my $self = shift; + my $item_type = $_[0]; + my $item_param = $_[1]; + my $indent_level = $self->{_item_indent}; + + if ($item_type eq 'bullet') { + $self->_append('*' x $indent_level . ' '); + } + elsif ($item_type eq 'number') { + $self->_append('#' x $indent_level . ' '); + } + elsif ($item_type eq 'text') { + $self->_append('- '); + } +} + + +############################################################################### +# +# _handle_text() +# +# Perform any necessary transforms on the text. This is mainly used to escape +# inadvertent CamelCase words. +# +sub _handle_text { + + my $self = shift; + my $text = $_[0]; + + # Only escape words in paragraphs + if (not $self->{_in_Para}) { + $self->{_wiki_text} .= $text; + return; + } + + # Split the text into tokens but maintain the whitespace + my @tokens = split /(\s+)/, $text; + + # Escape any tokens here, if necessary. + + # Rejoin the tokens and whitespace. + $self->{_wiki_text} .= join '', @tokens; +} + + +############################################################################### +# +# Functions to deal with =over ... =back regions for +# +# Bulleted lists +# Numbered lists +# Text lists +# Block lists +# +sub _end_item_text {$_[0]->_output(' := ')} + + +############################################################################### +# +# _start_Para() +# +# Special handling for paragraphs that are part of an "over" block. +# +sub _start_Para { + + my $self = shift; + my $indent_level = $self->{_item_indent}; + + if ($self->{_in_over_block}) { + $self->_append('bq.. '); + } +} + + +1; + + +__END__ + + +=head1 NAME + +Pod::Simple::Wiki::Textile - A class for creating Pod to Textile wiki filters. + +=head1 SYNOPSIS + +This module isn't used directly. Instead it is called via C: + + #!/usr/bin/perl -w + + use strict; + use Pod::Simple::Wiki; + + + my $parser = Pod::Simple::Wiki->new('textile'); + + ... + + +Convert Pod to a Textile wiki format using the installed C utility: + + pod2wiki --style textile file.pod > file.wiki + + +=head1 DESCRIPTION + +The C module is used for converting Pod text to Wiki text. + +Pod (Plain Old Documentation) is a simple markup language used for writing Perl documentation. + +For an introduction to Textile see: http://textile.thresholdstate.com/ + +This module isn't generally invoked directly. Instead it is called via C. See the L and L documentation for more information. + + +=head1 METHODS + +Pod::Simple::Wiki::Textile inherits all of the methods of C and C. See L and L for more details. + + +=head1 SEE ALSO + +This module also installs a C command line utility. See C for details. + + +=head1 DISCLAIMER OF WARRANTY + +Please refer to the DISCLAIMER OF WARRANTY in L. + + +=head1 AUTHOR + +John McNamara jmcnamara@cpan.org + + +=head1 COPYRIGHT + +MMIII-MMVIII, John McNamara. + +All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself. diff -Nru libpod-simple-wiki-perl-0.08/lib/Pod/Simple/Wiki/Tiddlywiki.pm libpod-simple-wiki-perl-0.11/lib/Pod/Simple/Wiki/Tiddlywiki.pm --- libpod-simple-wiki-perl-0.08/lib/Pod/Simple/Wiki/Tiddlywiki.pm 2007-08-25 18:10:20.000000000 +0100 +++ libpod-simple-wiki-perl-0.11/lib/Pod/Simple/Wiki/Tiddlywiki.pm 2009-08-27 01:33:44.000000000 +0100 @@ -215,6 +215,6 @@ =head1 COPYRIGHT -© MMIII-MMVII, John McNamara. +© MMIII-MMVIII, John McNamara. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself. diff -Nru libpod-simple-wiki-perl-0.08/lib/Pod/Simple/Wiki/Twiki.pm libpod-simple-wiki-perl-0.11/lib/Pod/Simple/Wiki/Twiki.pm --- libpod-simple-wiki-perl-0.08/lib/Pod/Simple/Wiki/Twiki.pm 2007-08-25 18:10:20.000000000 +0100 +++ libpod-simple-wiki-perl-0.11/lib/Pod/Simple/Wiki/Twiki.pm 2009-08-27 01:33:44.000000000 +0100 @@ -5,7 +5,7 @@ # Pod::Simple::Wiki::Twiki - A class for creating Pod to Twiki filters. # # -# Copyright 2003-2007, John McNamara, jmcnamara@cpan.org +# Copyright 2003-2008, John McNamara, jmcnamara@cpan.org # # Documentation after __END__ # @@ -205,6 +205,6 @@ =head1 COPYRIGHT -© MMIII-MMVII, John McNamara. +© MMIII-MMVIII, John McNamara. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself. diff -Nru libpod-simple-wiki-perl-0.08/lib/Pod/Simple/Wiki/Usemod.pm libpod-simple-wiki-perl-0.11/lib/Pod/Simple/Wiki/Usemod.pm --- libpod-simple-wiki-perl-0.08/lib/Pod/Simple/Wiki/Usemod.pm 2007-08-25 18:10:20.000000000 +0100 +++ libpod-simple-wiki-perl-0.11/lib/Pod/Simple/Wiki/Usemod.pm 2009-08-27 01:33:44.000000000 +0100 @@ -5,7 +5,7 @@ # Pod::Simple::Wiki::Usemod - A class for creating Pod to Usemod filters. # # -# Copyright 2003-2007, John McNamara, jmcnamara@cpan.org +# Copyright 2003-2008, John McNamara, jmcnamara@cpan.org # # Documentation after __END__ # @@ -205,6 +205,6 @@ =head1 COPYRIGHT -© MMIII-MMVII, John McNamara. +© MMIII-MMVIII, John McNamara. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself. diff -Nru libpod-simple-wiki-perl-0.08/lib/Pod/Simple/Wiki.pm libpod-simple-wiki-perl-0.11/lib/Pod/Simple/Wiki.pm --- libpod-simple-wiki-perl-0.08/lib/Pod/Simple/Wiki.pm 2007-08-25 21:10:49.000000000 +0100 +++ libpod-simple-wiki-perl-0.11/lib/Pod/Simple/Wiki.pm 2009-08-29 14:46:39.000000000 +0100 @@ -5,7 +5,7 @@ # Pod::Simple::Wiki - A class for creating Pod to Wiki filters. # # -# Copyright 2003-2007, John McNamara, jmcnamara@cpan.org +# Copyright 2003-2008, John McNamara, jmcnamara@cpan.org # # Documentation after __END__ # @@ -16,7 +16,7 @@ use vars qw(@ISA $VERSION); @ISA = qw(Pod::Simple); -$VERSION = '0.08'; +$VERSION = '0.11'; ############################################################################### @@ -402,7 +402,7 @@ =head1 VERSION -This document refers to version 0.08 of Pod::Simple::Wiki, released August 25 2007. +This document refers to version 0.09 of Pod::Simple::Wiki, released May 24 2008. =head1 SYNOPSIS @@ -466,8 +466,10 @@ usemod twiki tiddlywiki + textile wikipedia or mediawiki moinmoin + confluence =head2 Other methods @@ -501,13 +503,21 @@ This is the format used by the TiddlyWiki. See: http://www.tiddlywiki.com/ +=item textile + +The Textile markup format as used on GitHub. See: http://textile.thresholdstate.com/ + =item wikipedia or mediawiki This is the format used by Wikipedia and MediaWiki wikis. See: http://www.mediawiki.org/ =item moinmoin -This is the format used by MoinMoin wikis. See: http://moinmoin.wikiwikiweb.de/ +This is the format used by MoinMoin wikis. See: http://moinmo.in/MoinMoinWiki + +=item confluence + +This is the format used by Confluence. See: http://www.atlassian.com/software/confluence/ =back @@ -520,6 +530,7 @@ If you are interested in porting a new wiki format have a look at L. +The C git repository is: http://github.com/jmcnamara/pod-simple-wiki/ =head1 SEE ALSO @@ -532,14 +543,6 @@ =item * -Add more code, more tests and a few more users if possible. - -=item * - -Add other Wiki formats. Send requests or patches. - -=item * - Fix some of the C<=over> edge cases. See the TODOs in the test programs. =back @@ -559,6 +562,7 @@ Thanks Tim Bunce for the TiddlyWiki prod and Ron Savage for the port. +Thanks to David Bartle, Andrew Hobbs and Jim Renwick for confluence patches. =head1 DISCLAIMER OF WARRANTY @@ -568,6 +572,11 @@ In no event unless required by applicable law or agreed to in writing will any copyright holder, or any other party who may modify and/or redistribute the software as permitted by the above licence, be liable to you for damages, including any general, special, incidental, or consequential damages arising out of the use or inability to use the software (including but not limited to loss of data or data being rendered inaccurate or losses sustained by you or third parties or a failure of the software to operate with any other software), even if such holder or other party has been advised of the possibility of such damages. +=head1 LICENSE + +Either the Perl Artistic Licence http://dev.perl.org/licenses/artistic.html or the GPL http://www.opensource.org/licenses/gpl-license.php + + =head1 AUTHOR John McNamara jmcnamara@cpan.org @@ -575,6 +584,6 @@ =head1 COPYRIGHT -© MMIII-MMVII, John McNamara. +MMIII-MMVIII, John McNamara. All Rights Reserved. This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself. diff -Nru libpod-simple-wiki-perl-0.08/Makefile.PL libpod-simple-wiki-perl-0.11/Makefile.PL --- libpod-simple-wiki-perl-0.08/Makefile.PL 2007-02-01 15:39:52.000000000 +0000 +++ libpod-simple-wiki-perl-0.11/Makefile.PL 2009-08-28 21:36:10.000000000 +0100 @@ -10,5 +10,6 @@ 'NEEDS_LINKING' => 0, 'PREREQ_PM' => {Pod::Simple => 0}, 'dist' => {COMPRESS => 'gzip --best', SUFFIX => 'gz'}, - 'EXE_FILES' => ['bin/pod2wiki'], + 'EXE_FILES' => ['bin/pod2wiki'], + 'LICENSE' => 'perl', ); diff -Nru libpod-simple-wiki-perl-0.08/MANIFEST libpod-simple-wiki-perl-0.11/MANIFEST --- libpod-simple-wiki-perl-0.08/MANIFEST 2007-08-25 17:51:37.000000000 +0100 +++ libpod-simple-wiki-perl-0.11/MANIFEST 2009-08-28 21:00:35.000000000 +0100 @@ -12,6 +12,8 @@ lib/Pod/Simple/Wiki/Tiddlywiki.pm lib/Pod/Simple/Wiki/Twiki.pm lib/Pod/Simple/Wiki/Usemod.pm +lib/Pod/Simple/Wiki/Confluence.pm +lib/Pod/Simple/Wiki/Textile.pm bin/pod2wiki @@ -48,3 +50,11 @@ t/07_02_tiddlywiki_head.t t/07_03_tiddlywiki_lists.t +t/08_01_confluence_format.t +t/08_02_confluence_head.t +t/08_03_confluence_lists.t + +t/09_01_textile_format.t +t/09_02_textile_head.t +t/09_03_textile_lists.t + diff -Nru libpod-simple-wiki-perl-0.08/META.yml libpod-simple-wiki-perl-0.11/META.yml --- libpod-simple-wiki-perl-0.08/META.yml 2007-08-25 18:15:38.000000000 +0100 +++ libpod-simple-wiki-perl-0.11/META.yml 2009-08-29 14:50:32.000000000 +0100 @@ -1,11 +1,22 @@ -name: Pod-Simple-Wiki -abstract: A class for creating Pod to Wiki filters. -version: 0.08 -version_from: lib/Pod/Simple/Wiki.pm -installdirs: site -requires: - Pod::Simple: 0 - -distribution_type: module -license: perl -generated_by: hand +--- #YAML:1.0 +name: Pod-Simple-Wiki +version: 0.11 +abstract: A class for creating Pod to Wiki filters. +author: + - John McNamara (jmcnamara@cpan.org) +license: perl +distribution_type: module +configure_requires: + ExtUtils::MakeMaker: 0 +build_requires: + ExtUtils::MakeMaker: 0 +requires: + Pod::Simple: 0 +no_index: + directory: + - t + - inc +generated_by: ExtUtils::MakeMaker version 6.54 +meta-spec: + url: http://module-build.sourceforge.net/META-spec-v1.4.html + version: 1.4 diff -Nru libpod-simple-wiki-perl-0.08/t/01_01_wiki_format.t libpod-simple-wiki-perl-0.11/t/01_01_wiki_format.t --- libpod-simple-wiki-perl-0.08/t/01_01_wiki_format.t 2007-02-01 15:39:52.000000000 +0000 +++ libpod-simple-wiki-perl-0.11/t/01_01_wiki_format.t 2009-08-27 01:33:44.000000000 +0100 @@ -61,7 +61,7 @@ my $test = 1; - print "\n----\n\n"; + print "\n\n"; for my $test_ref (@tests) { @@ -70,7 +70,7 @@ my $name = $test_ref->[2]; $pod =~ s/=pod\n\n//; - $pod = "=pod\n\n=head1 Test ". $test++ . " $name\n\n$pod"; + $pod = "=pod\n\n=head2 Test ". $test++ . " $name\n\n$pod"; $parser->parse_string_document($pod); } diff -Nru libpod-simple-wiki-perl-0.08/t/02_01_kwiki_format.t libpod-simple-wiki-perl-0.11/t/02_01_kwiki_format.t --- libpod-simple-wiki-perl-0.08/t/02_01_kwiki_format.t 2007-02-01 15:39:52.000000000 +0000 +++ libpod-simple-wiki-perl-0.11/t/02_01_kwiki_format.t 2009-08-27 01:33:44.000000000 +0100 @@ -61,7 +61,7 @@ my $test = 1; - print "\n----\n\n"; + print "\n\n"; for my $test_ref (@tests) { @@ -70,7 +70,7 @@ my $name = $test_ref->[2]; $pod =~ s/=pod\n\n//; - $pod = "=pod\n\n=head1 Test ". $test++ . " $name\n\n$pod"; + $pod = "=pod\n\n=head2 Test ". $test++ . " $name\n\n$pod"; $parser->parse_string_document($pod); } diff -Nru libpod-simple-wiki-perl-0.08/t/03_01_usemod_format.t libpod-simple-wiki-perl-0.11/t/03_01_usemod_format.t --- libpod-simple-wiki-perl-0.08/t/03_01_usemod_format.t 2007-02-01 15:39:52.000000000 +0000 +++ libpod-simple-wiki-perl-0.11/t/03_01_usemod_format.t 2009-08-27 01:33:44.000000000 +0100 @@ -61,7 +61,7 @@ my $test = 1; - print "\n----\n\n"; + print "\n\n"; for my $test_ref (@tests) { @@ -70,7 +70,7 @@ my $name = $test_ref->[2]; $pod =~ s/=pod\n\n//; - $pod = "=pod\n\n=head1 Test ". $test++ . " $name\n\n$pod"; + $pod = "=pod\n\n=head2 Test ". $test++ . " $name\n\n$pod"; $parser->parse_string_document($pod); } diff -Nru libpod-simple-wiki-perl-0.08/t/04_01_twiki_format.t libpod-simple-wiki-perl-0.11/t/04_01_twiki_format.t --- libpod-simple-wiki-perl-0.08/t/04_01_twiki_format.t 2007-02-01 15:39:52.000000000 +0000 +++ libpod-simple-wiki-perl-0.11/t/04_01_twiki_format.t 2009-08-27 01:33:44.000000000 +0100 @@ -63,7 +63,7 @@ my $test = 1; - print "\n----\n\n"; + print "\n\n"; for my $test_ref (@tests) { @@ -72,7 +72,7 @@ my $name = $test_ref->[2]; $pod =~ s/=pod\n\n//; - $pod = "=pod\n\n=head1 Test ". $test++ . " $name\n\n$pod"; + $pod = "=pod\n\n=head2 Test ". $test++ . " $name\n\n$pod"; $parser->parse_string_document($pod); } diff -Nru libpod-simple-wiki-perl-0.08/t/05_01_mediawiki_format.t libpod-simple-wiki-perl-0.11/t/05_01_mediawiki_format.t --- libpod-simple-wiki-perl-0.08/t/05_01_mediawiki_format.t 2007-08-25 17:54:45.000000000 +0100 +++ libpod-simple-wiki-perl-0.11/t/05_01_mediawiki_format.t 2009-08-27 01:33:44.000000000 +0100 @@ -68,7 +68,7 @@ my $test = 1; - print "\n----\n\n"; + print "\n\n"; for my $test_ref (@tests) { @@ -77,7 +77,7 @@ my $name = $test_ref->[2]; $pod =~ s/=pod\n\n//; - $pod = "=pod\n\n=head1 Test ". $test++ . " $name\n\n$pod"; + $pod = "=pod\n\n=head2 Test ". $test++ . " $name\n\n$pod"; $parser->parse_string_document($pod); } diff -Nru libpod-simple-wiki-perl-0.08/t/06_01_moinmoin_format.t libpod-simple-wiki-perl-0.11/t/06_01_moinmoin_format.t --- libpod-simple-wiki-perl-0.08/t/06_01_moinmoin_format.t 2007-02-01 15:39:52.000000000 +0000 +++ libpod-simple-wiki-perl-0.11/t/06_01_moinmoin_format.t 2009-08-27 01:33:44.000000000 +0100 @@ -61,7 +61,7 @@ my $test = 1; - print "\n----\n\n"; + print "\n\n"; for my $test_ref (@tests) { @@ -70,7 +70,7 @@ my $name = $test_ref->[2]; $pod =~ s/=pod\n\n//; - $pod = "=pod\n\n=head1 Test ". $test++ . " $name\n\n$pod"; + $pod = "=pod\n\n=head2 Test ". $test++ . " $name\n\n$pod"; $parser->parse_string_document($pod); } diff -Nru libpod-simple-wiki-perl-0.08/t/07_01_tiddlywiki_format.t libpod-simple-wiki-perl-0.11/t/07_01_tiddlywiki_format.t --- libpod-simple-wiki-perl-0.08/t/07_01_tiddlywiki_format.t 2007-08-25 15:53:00.000000000 +0100 +++ libpod-simple-wiki-perl-0.11/t/07_01_tiddlywiki_format.t 2009-08-27 01:33:44.000000000 +0100 @@ -61,6 +61,8 @@ my $test = 1; + print "\n\n"; + for my $test_ref (@tests) { my $parser = Pod::Simple::Wiki->new($style); @@ -68,7 +70,7 @@ my $name = $test_ref->[2]; $pod =~ s/=pod\n\n//; - $pod = "=pod\n\n=head1 Test ". $test++ . " $name\n\n$pod"; + $pod = "=pod\n\n=head2 Test ". $test++ . " $name\n\n$pod"; $parser->parse_string_document($pod); } diff -Nru libpod-simple-wiki-perl-0.08/t/08_01_confluence_format.t libpod-simple-wiki-perl-0.11/t/08_01_confluence_format.t --- libpod-simple-wiki-perl-0.08/t/08_01_confluence_format.t 1970-01-01 01:00:00.000000000 +0100 +++ libpod-simple-wiki-perl-0.11/t/08_01_confluence_format.t 2009-08-27 01:33:44.000000000 +0100 @@ -0,0 +1,81 @@ +#!/usr/bin/perl -w + +############################################################################### +# +# A test for Pod::Simple::Wiki. +# +# Tests for I<>, B<>, C<> etc., formatting codes. +# +# reverse('©'), August 2004, John McNamara, jmcnamara@cpan.org +# + + +use strict; + +use Pod::Simple::Wiki; +use Test::More tests => 6; + +my $style = 'confluence'; + +# Output the tests for visual testing in the wiki. +# END{output_tests()}; + +my @tests = ( + # Simple formatting tests + [ "=pod\n\nI" => qq(_Foo_\n\n), 'Italic' ], + [ "=pod\n\nB" => qq(*Foo*\n\n), 'Bold' ], + [ "=pod\n\nC" => qq({{Foo}}\n\n), 'Monospace' ], + [ "=pod\n\nF" => qq(_Foo_\n\n), 'Filename' ], + + # Nested formatting tests + [ "=pod\n\nB>" => qq(*_Foo_*\n\n), 'Bold Italic'], + [ "=pod\n\nI>" => qq(_*Foo*_\n\n), 'Italic Bold'], +); + + + +############################################################################### +# +# Run the tests. +# +for my $test_ref (@tests) { + + my $parser = Pod::Simple::Wiki->new($style); + my $pod = $test_ref->[0]; + my $target = $test_ref->[1]; + my $name = $test_ref->[2]; + my $wiki; + + $parser->output_string(\$wiki); + $parser->parse_string_document($pod); + + is($wiki, $target, "\tTesting: $name"); +} + + +############################################################################### +# +# Output the tests for visual testing in the wiki. +# +sub output_tests { + + my $test = 1; + + print "\n\n"; + + for my $test_ref (@tests) { + + my $parser = Pod::Simple::Wiki->new($style); + my $pod = $test_ref->[0]; + my $name = $test_ref->[2]; + + $pod =~ s/=pod\n\n//; + $pod = "=pod\n\n=head2 Test ". $test++ . " $name\n\n$pod"; + + $parser->parse_string_document($pod); + } +} + + +__END__ + diff -Nru libpod-simple-wiki-perl-0.08/t/08_02_confluence_head.t libpod-simple-wiki-perl-0.11/t/08_02_confluence_head.t --- libpod-simple-wiki-perl-0.08/t/08_02_confluence_head.t 1970-01-01 01:00:00.000000000 +0100 +++ libpod-simple-wiki-perl-0.11/t/08_02_confluence_head.t 2009-08-27 02:05:21.000000000 +0100 @@ -0,0 +1,93 @@ +#!/usr/bin/perl -w + +############################################################################### +# +# A test for Pod::Simple::Wiki. +# +# Tests for =head pod directives. +# +# reverse('©'), August 2004, John McNamara, jmcnamara@cpan.org +# + + +use strict; + +use Pod::Simple::Wiki; +use Test::More tests => 4; + +my $style = 'confluence'; + +# Output the tests for visual testing in the wiki. +# END{output_tests()}; + +my @tests = ( + [ "=pod\n\n=head1 Head 1" => qq(h1. Head 1\n\n)], + [ "=pod\n\n=head2 Head 2" => qq(h2. Head 2\n\n)], + [ "=pod\n\n=head3 Head 3" => qq(h3. Head 3\n\n)], + [ "=pod\n\n=head4 Head 4" => qq(h4. Head 4\n\n)], + ); + + + + +############################################################################### +# +# Run the tests. +# +for my $test_ref (@tests) { + + my $parser = Pod::Simple::Wiki->new($style); + my $pod = $test_ref->[0]; + my $target = $test_ref->[1]; + my $wiki; + + $parser->output_string(\$wiki); + $parser->parse_string_document($pod); + + + is($wiki, $target, "\tTesting: " . encode_escapes($pod)); +} + + +############################################################################### +# +# Encode escapes to make them visible in the test output. +# +sub encode_escapes { + my $data = $_[0]; + + for ($data) { + s/\t/\\t/g; + s/\n/\\n/g; + } + + return $data; +} + + +############################################################################### +# +# Output the tests for visual testing in the wiki. +# +sub output_tests { + + my $test = 1; + + print "\n\n"; + + for my $test_ref (@tests) { + + my $parser = Pod::Simple::Wiki->new($style); + my $pod = $test_ref->[0]; + my $pod2 = encode_escapes($pod); + $pod2 =~ s/^=pod\\n\\n//; + + print "h2. Test ", $test++, ":\t", $pod2, "\n"; + $parser->parse_string_document($pod); + } +} + +__END__ + + + diff -Nru libpod-simple-wiki-perl-0.08/t/08_03_confluence_lists.t libpod-simple-wiki-perl-0.11/t/08_03_confluence_lists.t --- libpod-simple-wiki-perl-0.08/t/08_03_confluence_lists.t 1970-01-01 01:00:00.000000000 +0100 +++ libpod-simple-wiki-perl-0.11/t/08_03_confluence_lists.t 2009-08-27 01:33:44.000000000 +0100 @@ -0,0 +1,538 @@ +#!/usr/bin/perl -w + +############################################################################### +# +# A test for Pod::Simple::Wiki. +# +# Tests for =over ... =back regions. +# +# reverse('©'), March 2005, John McNamara, jmcnamara@cpan.org +# + + +use strict; + +use Pod::Simple::Wiki; +use Test::More tests => 12; + +my $style = 'confluence'; + +# Output the tests for visual testing in the wiki. +# END{output_tests()}; + +my @tests; + +# +# Extract tests embedded in _DATA_ section. +# +my $test_no = 1; +my $pod; +my $test = ''; +my $todo = '';; +my $name; + +while () { + if (/^#/) { + $name = $1 if /NAME: (.*)/; + $todo = $1 if /TODO: (.*)/; + + if ($test) { + if ($test_no % 2) { + $pod = $test; + } + else { + push @tests, [$pod, $test, $name, $todo]; + $name = ''; + $todo = ''; + } + + $test = ''; + $test_no++; + } + next; + } + s/\r//; # Remove any \r chars that slip in. + s/\\t/\t/g; # Sub back in any escaped tabs. + s/\\#/#/g; # Sub back in any escaped comments. + $test .= $_; +} + + +############################################################################### +# +# Run the tests. +# +for my $test_ref (@tests) { + + my $parser = Pod::Simple::Wiki->new($style); + my $pod = $test_ref->[0]; + my $target = $test_ref->[1]; + my $name = $test_ref->[2]; + my $todo = $test_ref->[3]; + my $wiki; + + $parser->output_string(\$wiki); + $parser->parse_string_document($pod); + + local $TODO = $todo; + is($wiki, $target, " \t" . $name); +} + + +############################################################################### +# +# Output the tests for visual testing in the wiki. +# +sub output_tests { + + my $test = 1; + + print "\n\n"; + + for my $test_ref (@tests) { + + my $parser = Pod::Simple::Wiki->new($style); + my $pod = $test_ref->[0]; + my $name = $test_ref->[2]; + + print "h2. Test ", $test++, ":\t", $name, "\n"; + $parser->parse_string_document($pod); + } +} + +__DATA__ +################################################################################ +# +# Test data. +# +################################################################################ +# +# NAME: Test for single unordered (bullet) item. +# +=pod + +=over + +=item * + +Bullet item + +=back + +=cut +# +# +# Expected output. +# +# +* Bullet item + +################################################################################ +# +# NAME: Test for unordered (bullet) list,
    . +# +=pod + +=over + +=item * + +Bullet item 1.0 + +=item * + +Bullet item 2.0 + +=item * + +Bullet item 3.0 + +=back + +=cut +# +# +# Expected output. +# +# +* Bullet item 1.0 +* Bullet item 2.0 +* Bullet item 3.0 + +############################################################################### +# +# NAME: Test for nested unordered (bullet) list,
      . +# +=pod + +=over + +=item * + +Bullet item 1.0 + +=over + +=item * + +Bullet item 1.1 + +=over + +=item * + +Bullet item 1.2 + +=item * + +Bullet item 2.2 + +=back + + +=item * + +Bullet item 2.1 + +=back + +=item * + +Bullet item 2.0 + +=back + +=cut +# +# +# Expected output. +# +# +* Bullet item 1.0 +** Bullet item 1.1 +*** Bullet item 1.2 +*** Bullet item 2.2 +** Bullet item 2.1 +* Bullet item 2.0 + +################################################################################ +# +# NAME: Test for single ordered (number) item. +# +=pod + +=over + +=item 1 + +Number item + +=back + +=cut +# +# +# Expected output. +# +# +\# Number item + +############################################################################### +# +# NAME: Test for ordered (number) list,
        . +# +=pod + +=over + +=item 1 + +Number item 1.0 + +=item 2 + +Number item 2.0 + +=item 3 + +Number item 3.0 + +=back + +=cut +# +# +# Expected output. +# +# +\# Number item 1.0 +\# Number item 2.0 +\# Number item 3.0 + +############################################################################### +# +# NAME: Test for nested ordered (number) list,
          . +# +=pod + +=over + +=item 1 + +Number item 1.0 + +=over + +=item 1 + +Number item 1.1 + +=over + +=item 1 + +Number item 1.2 + +=item 2 + +Number item 2.2 + +=back + +=item 2 + +Number item 2.1 + +=back + +=item 2 + +Number item 2.0 + +=back + +=cut +# +# +# Expected output. +# +# +\# Number item 1.0 +\## Number item 1.1 +\### Number item 1.2 +\### Number item 2.2 +\## Number item 2.1 +\# Number item 2.0 + +################################################################################ +# +# NAME: Test for single definition list item. +# +=pod + +=over + +=item Foo + +Definition item + +=back + +=cut +# +# +# Expected output. +# +# +* *Foo* Definition item + +############################################################################### +# +# NAME: Test for definition list,
          . +# +=pod + +=over + +=item Foo + +Definition item 1.0 + +=item Bar + +Definition item 2.0 + +=item Baz + +Definition item 3.0 + +=back + +=cut +# +# +# Expected output. +# +# +* *Foo* Definition item 1.0 +* *Bar* Definition item 2.0 +* *Baz* Definition item 3.0 + +############################################################################### +# +# NAME: Test for nested definition list,
          . +# +=pod + +=over + +=item Foo + +Definition item 1.0 + +=over + +=item Foo + +Definition item 1.1 + +=over + +=item Foo + +Definition item 1.2 + +=item Bar + +Definition item 2.2 + +=back + +=item Bar + +Definition item 2.1 + +=back + +=item Bar + +Definition item 2.0 + +=back + +=cut +# +# +# Expected output. +# +# +* *Foo* Definition item 1.0 +** *Foo* Definition item 1.1 +*** *Foo* Definition item 1.2 +*** *Bar* Definition item 2.2 +** *Bar* Definition item 2.1 +* *Bar* Definition item 2.0 + +############################################################################### +# +# NAME: Test for varied nested list. +# +=pod + +=over + +=item * + +Bullet item 1.0 + +=over + +=item 1 + +Number item 1.1 + +=over + +=item Foo + +Definition item 1.2 + +=item Bar + +Definition item 2.2 + +=back + +=item 2 + +Number item 2.1 + +=back + +=item * + +Bullet item 2.0 + +=back + +=cut +# +# +# Expected output. +# +# +* Bullet item 1.0 +\## Number item 1.1 +*** *Foo* Definition item 1.2 +*** *Bar* Definition item 2.2 +\## Number item 2.1 +* Bullet item 2.0 + +################################################################################ +# +# NAME: Test for definition list without =items,
          . +# +# +=pod + +=over + +This is a long sentence that forms part of a definition block. + +=back + +=cut +# +# +# Expected output. +# +# +bq. This is a long sentence that forms part of a definition block. + +################################################################################ +# +# NAME: Test for definition list without a definition. +# +# TODO: Fix this later. +# +=pod + +=over + +=item This is a long sentence that forms part of a definition block. + +=back + +=cut +# +# +# Expected output. +# +# +* *This is a long sentence that forms part of a definition block.* + +############################################################################### +# +# End +# +############################################################################### diff -Nru libpod-simple-wiki-perl-0.08/t/09_01_textile_format.t libpod-simple-wiki-perl-0.11/t/09_01_textile_format.t --- libpod-simple-wiki-perl-0.08/t/09_01_textile_format.t 1970-01-01 01:00:00.000000000 +0100 +++ libpod-simple-wiki-perl-0.11/t/09_01_textile_format.t 2009-08-27 02:58:43.000000000 +0100 @@ -0,0 +1,81 @@ +#!/usr/bin/perl -w + +############################################################################### +# +# A test for Pod::Simple::Wiki. +# +# Tests for I<>, B<>, C<> etc., formatting codes. +# +# reverse('©'), December 2005, John McNamara, jmcnamara@cpan.org +# + + +use strict; + +use Pod::Simple::Wiki; +use Test::More tests => 6; + +my $style = 'textile'; + +# Output the tests for visual testing in the wiki. +# END{output_tests()}; + +my @tests = ( + # Simple formatting tests + [ "=pod\n\nI" => qq(_Foo_\n\n), 'Italic' ], + [ "=pod\n\nB" => qq(*Foo*\n\n), 'Bold' ], + [ "=pod\n\nC" => qq(\@Foo\@\n\n), 'Monospace' ], + [ "=pod\n\nF" => qq(_Foo_\n\n), 'Filename' ], + + # Nested formatting tests + [ "=pod\n\nB>" => qq(*_Foo_*\n\n), 'Bold Italic'], + [ "=pod\n\nI>" => qq(_*Foo*_\n\n), 'Italic Bold'], +); + + + +############################################################################### +# +# Run the tests. +# +for my $test_ref (@tests) { + + my $parser = Pod::Simple::Wiki->new($style); + my $pod = $test_ref->[0]; + my $target = $test_ref->[1]; + my $name = $test_ref->[2]; + my $wiki; + + $parser->output_string(\$wiki); + $parser->parse_string_document($pod); + + is($wiki, $target, "\tTesting: $name"); +} + + +############################################################################### +# +# Output the tests for visual testing in the wiki. +# +sub output_tests { + + my $test = 1; + + print "\n\n"; + + for my $test_ref (@tests) { + + my $parser = Pod::Simple::Wiki->new($style); + my $pod = $test_ref->[0]; + my $name = $test_ref->[2]; + + $pod =~ s/=pod\n\n//; + $pod = "=pod\n\n=head2 Test ". $test++ . " $name\n\n$pod"; + + $parser->parse_string_document($pod); + } +} + + +__END__ + diff -Nru libpod-simple-wiki-perl-0.08/t/09_02_textile_head.t libpod-simple-wiki-perl-0.11/t/09_02_textile_head.t --- libpod-simple-wiki-perl-0.08/t/09_02_textile_head.t 1970-01-01 01:00:00.000000000 +0100 +++ libpod-simple-wiki-perl-0.11/t/09_02_textile_head.t 2009-08-27 02:58:43.000000000 +0100 @@ -0,0 +1,94 @@ +#!/usr/bin/perl -w + +############################################################################### +# +# A test for Pod::Simple::Wiki. +# +# Tests for =head pod directives. +# +# reverse('©'), August 2004, John McNamara, jmcnamara@cpan.org +# + + +use strict; + +use Pod::Simple::Wiki; +use Test::More tests => 4; + +my $style = 'textile'; + +# Output the tests for visual testing in the wiki. +# END{output_tests()}; + +my @tests = ( + [ "=pod\n\n=head1 Head 1" => qq(h1. Head 1\n\n)], + [ "=pod\n\n=head2 Head 2" => qq(h2. Head 2\n\n)], + [ "=pod\n\n=head3 Head 3" => qq(h3. Head 3\n\n)], + [ "=pod\n\n=head4 Head 4" => qq(h4. Head 4\n\n)], + ); + + + + +############################################################################### +# +# Run the tests. +# +for my $test_ref (@tests) { + + my $parser = Pod::Simple::Wiki->new($style); + my $pod = $test_ref->[0]; + my $target = $test_ref->[1]; + my $wiki; + + $parser->output_string(\$wiki); + $parser->parse_string_document($pod); + + + is($wiki, $target, "\tTesting: " . encode_escapes($pod)); +} + + +############################################################################### +# +# Encode escapes to make them visible in the test output. +# +sub encode_escapes { + my $data = $_[0]; + + for ($data) { + s/\t/\\t/g; + s/\n/\\n/g; + } + + return $data; +} + + +############################################################################### +# +# Output the tests for visual testing in the wiki. +# +sub output_tests { + + my $test = 1; + + for my $test_ref (@tests) { + + print "\n"; + + my $parser = Pod::Simple::Wiki->new($style); + my $pod = $test_ref->[0]; + my $pod2 = encode_escapes($pod); + $pod2 =~ s/^=pod\\n\\n//; + + print "*Test ", $test++, "*: @", $pod2, "@\n\n"; + $parser->parse_string_document($pod); + print "\n"; + } +} + +__END__ + + + diff -Nru libpod-simple-wiki-perl-0.08/t/09_03_textile_lists.t libpod-simple-wiki-perl-0.11/t/09_03_textile_lists.t --- libpod-simple-wiki-perl-0.08/t/09_03_textile_lists.t 1970-01-01 01:00:00.000000000 +0100 +++ libpod-simple-wiki-perl-0.11/t/09_03_textile_lists.t 2009-08-27 02:58:43.000000000 +0100 @@ -0,0 +1,540 @@ +#!/usr/bin/perl -w + +############################################################################### +# +# A test for Pod::Simple::Wiki. +# +# Tests for =over ... =back regions. +# +# reverse('©'), March 2005, John McNamara, jmcnamara@cpan.org +# + + +use strict; + +use Pod::Simple::Wiki; +use Test::More tests => 12; + +my $style = 'textile'; + +# Output the tests for visual testing in the wiki. +# END{output_tests()}; + +my @tests; + +# +# Extract tests embedded in _DATA_ section. +# +my $test_no = 1; +my $pod; +my $test = ''; +my $todo = '';; +my $name; + +while () { + if (/^#/) { + $name = $1 if /NAME: (.*)/; + $todo = $1 if /TODO: (.*)/; + + if ($test) { + if ($test_no % 2) { + $pod = $test; + } + else { + push @tests, [$pod, $test, $name, $todo]; + $name = ''; + $todo = ''; + } + + $test = ''; + $test_no++; + } + next; + } + s/\r//; # Remove any \r chars that slip in. + s/\\t/\t/g; # Sub back in any escaped tabs. + s/\\#/#/g; # Sub back in any escaped comments. + $test .= $_; +} + + +############################################################################### +# +# Run the tests. +# +for my $test_ref (@tests) { + + my $parser = Pod::Simple::Wiki->new($style); + my $pod = $test_ref->[0]; + my $target = $test_ref->[1]; + my $name = $test_ref->[2]; + my $todo = $test_ref->[3]; + my $wiki; + + $parser->output_string(\$wiki); + $parser->parse_string_document($pod); + + local $TODO = $todo; + is($wiki, $target, " \t" . $name); +} + + +############################################################################### +# +# Output the tests for visual testing in the wiki. +# +sub output_tests { + + my $test = 1; + + print "\n\n"; + + for my $test_ref (@tests) { + + my $parser = Pod::Simple::Wiki->new($style); + my $pod = $test_ref->[0]; + my $name = $test_ref->[2]; + + $name =~ s//>/g; + + print "h2. Test ", $test++, ":\t", $name, "\n\n"; + $parser->parse_string_document($pod); + } +} + +__DATA__ +################################################################################ +# +# Test data. +# +################################################################################ +# +# NAME: Test for single unordered (bullet) item. +# +=pod + +=over + +=item * + +Bullet item + +=back + +=cut +# +# +# Expected output. +# +# +* Bullet item + +################################################################################ +# +# NAME: Test for unordered (bullet) list,
            . +# +=pod + +=over + +=item * + +Bullet item 1.0 + +=item * + +Bullet item 2.0 + +=item * + +Bullet item 3.0 + +=back + +=cut +# +# +# Expected output. +# +# +* Bullet item 1.0 +* Bullet item 2.0 +* Bullet item 3.0 + +############################################################################### +# +# NAME: Test for nested unordered (bullet) list,
              . +# +=pod + +=over + +=item * + +Bullet item 1.0 + +=over + +=item * + +Bullet item 1.1 + +=over + +=item * + +Bullet item 1.2 + +=item * + +Bullet item 2.2 + +=back + + +=item * + +Bullet item 2.1 + +=back + +=item * + +Bullet item 2.0 + +=back + +=cut +# +# +# Expected output. +# +# +* Bullet item 1.0 +** Bullet item 1.1 +*** Bullet item 1.2 +*** Bullet item 2.2 +** Bullet item 2.1 +* Bullet item 2.0 + +################################################################################ +# +# NAME: Test for single ordered (number) item. +# +=pod + +=over + +=item 1 + +Number item + +=back + +=cut +# +# +# Expected output. +# +# +\# Number item + +############################################################################### +# +# NAME: Test for ordered (number) list,
                . +# +=pod + +=over + +=item 1 + +Number item 1.0 + +=item 2 + +Number item 2.0 + +=item 3 + +Number item 3.0 + +=back + +=cut +# +# +# Expected output. +# +# +\# Number item 1.0 +\# Number item 2.0 +\# Number item 3.0 + +############################################################################### +# +# NAME: Test for nested ordered (number) list,
                  . +# +=pod + +=over + +=item 1 + +Number item 1.0 + +=over + +=item 1 + +Number item 1.1 + +=over + +=item 1 + +Number item 1.2 + +=item 2 + +Number item 2.2 + +=back + +=item 2 + +Number item 2.1 + +=back + +=item 2 + +Number item 2.0 + +=back + +=cut +# +# +# Expected output. +# +# +\# Number item 1.0 +\## Number item 1.1 +\### Number item 1.2 +\### Number item 2.2 +\## Number item 2.1 +\# Number item 2.0 + +################################################################################ +# +# NAME: Test for single definition list item. +# +=pod + +=over + +=item Foo + +Definition item + +=back + +=cut +# +# +# Expected output. +# +# +- Foo := Definition item + +############################################################################### +# +# NAME: Test for definition list,
                  . +# +=pod + +=over + +=item Foo + +Definition item 1.0 + +=item Bar + +Definition item 2.0 + +=item Baz + +Definition item 3.0 + +=back + +=cut +# +# +# Expected output. +# +# +- Foo := Definition item 1.0 +- Bar := Definition item 2.0 +- Baz := Definition item 3.0 + +############################################################################### +# +# NAME: Test for nested definition list,
                  . +# +=pod + +=over + +=item Foo + +Definition item 1.0 + +=over + +=item Foo + +Definition item 1.1 + +=over + +=item Foo + +Definition item 1.2 + +=item Bar + +Definition item 2.2 + +=back + +=item Bar + +Definition item 2.1 + +=back + +=item Bar + +Definition item 2.0 + +=back + +=cut +# +# +# Expected output. +# +# +- Foo := Definition item 1.0 +- Foo := Definition item 1.1 +- Foo := Definition item 1.2 +- Bar := Definition item 2.2 +- Bar := Definition item 2.1 +- Bar := Definition item 2.0 + +############################################################################### +# +# NAME: Test for varied nested list. +# +=pod + +=over + +=item * + +Bullet item 1.0 + +=over + +=item 1 + +Number item 1.1 + +=over + +=item Foo + +Definition item 1.2 + +=item Bar + +Definition item 2.2 + +=back + +=item 2 + +Number item 2.1 + +=back + +=item * + +Bullet item 2.0 + +=back + +=cut +# +# +# Expected output. +# +# +* Bullet item 1.0 +\## Number item 1.1 +- Foo := Definition item 1.2 +- Bar := Definition item 2.2 +\## Number item 2.1 +* Bullet item 2.0 + +################################################################################ +# +# NAME: Test for definition list without =items,
                  . +# +=pod + +=over + +This is a long sentence that forms part of a definition block. + +=back + +=cut +# +# +# Expected output. +# +# +bq.. This is a long sentence that forms part of a definition block. + +################################################################################ +# +# NAME: Test for definition list without a definition. +# +# TODO: Fix this later. +# +=pod + +=over + +=item This is a long sentence that forms part of a definition block. + +=back + +=cut +# +# +# Expected output. +# +# +- := This is a long sentence that forms part of a definition block. + +############################################################################### +# +# End +# +###############################################################################