Changeset 239


Ignore:
Timestamp:
Apr 27, 2006, 7:35:26 PM (14 years ago)
Author:
Dominic Hargreaves
Message:

Final renames and release.

Location:
wiki-toolkit-formatter-usemod/trunk
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • wiki-toolkit-formatter-usemod/trunk/Changes

    r146 r239  
     10.19    27 April 2006
     2        Rename to Wiki::Toolkit::Formatter::UseMod
     3
    140.18    30 November 2004
    25        Skip CGI::Wiki-requiring tests if CGI::Wiki not installed (thanks
  • wiki-toolkit-formatter-usemod/trunk/MANIFEST

    r141 r239  
    33Makefile.PL
    44README
    5 lib/CGI/Wiki/Formatter/UseMod.pm
     5lib/Wiki/Toolkit/Formatter/UseMod.pm
    66t/default_links.t
    77t/encode-node-names.t
  • wiki-toolkit-formatter-usemod/trunk/Makefile.PL

    r119 r239  
    11use ExtUtils::MakeMaker;
    22
    3 WriteMakefile( NAME         => "CGI::Wiki::Formatter::UseMod",
    4                VERSION_FROM => "lib/CGI/Wiki/Formatter/UseMod.pm",
     3WriteMakefile( NAME         => "Wiki::Toolkit::Formatter::UseMod",
     4               VERSION_FROM => "lib/Wiki/Toolkit/Formatter/UseMod.pm",
    55               PREREQ_PM    => { 'Text::WikiFormat' => '0.71', # 0.7 buggy
    66                                 'HTML::PullParser' => 0,
  • wiki-toolkit-formatter-usemod/trunk/README

    r146 r239  
    11NAME
    2     CGI::Wiki::Formatter::UseMod - UseModWiki-style formatting for CGI::Wiki
     2    Wiki::Toolkit::Formatter::UseMod - UseModWiki-style formatting for Wiki::Toolkit
    33
    44DESCRIPTION
    5     A formatter backend for CGI::Wiki that supports UseMod-style formatting.
     5    A formatter backend for Wiki::Toolkit that supports UseMod-style formatting.
    66
    77SYNOPSIS
    8       use CGI::Wiki::Formatter::UseMod;
     8      use Wiki::Toolkit::Formatter::UseMod;
    99
    1010      # Instantiate - see below for parameter details.
    11       my $formatter = CGI::Wiki::Formatter::UseMod->new( %config );
     11      my $formatter = Wiki::Toolkit::Formatter::UseMod->new( %config );
    1212
    1313      # Format some text.
     
    1919METHODS
    2020    new
    21           my $formatter = CGI::Wiki::Formatter::UseMod->new(
     21          my $formatter = Wiki::Toolkit::Formatter::UseMod->new(
    2222                         extended_links      => 0, # $FreeLinks
    2323                         implicit_links      => 1, # $WikiLinks
     
    162162        supplied into HTML.
    163163
    164         A CGI::Wiki object can be supplied as an optional second parameter.
     164        A Wiki::Toolkit object can be supplied as an optional second parameter.
    165165        This object will be used to determine whether a linked-to node
    166166        exists or not, and alter the presentation of the link accordingly.
    167167        This is only really in here for use when this method is being called
    168         from within CGI::Wiki.
     168        from within Wiki::Toolkit.
    169169
    170170    format_link
     
    187187
    188188        "link" should be something that would go inside your extended link
    189         delimiters. "wiki" is optional but should be a CGI::Wiki object. If
     189        delimiters. "wiki" is optional but should be a Wiki::Toolkit object. If
    190190        you do supply "wiki" then the method will be able to check whether
    191191        the node exists yet or not and so will call "->make_edit_link"
     
    310310        params.
    311311
    312           my $formatter = CGI::Wiki::Formatter::UseMod->new( munge_urls => 1 );
     312          my $formatter = Wiki::Toolkit::Formatter::UseMod->new( munge_urls => 1 );
    313313          my $node_param = $q->param('id') || $q->param('keywords') || "";
    314314          my $node_name = $formatter->node_param_to_node_name( $node_param );
     
    321321
    322322SEE ALSO
    323         * CGI::Wiki
     323        * Wiki::Toolkit
    324324        * Text::WikiFormat
    325325        * UseModWiki (<http://www.usemod.com/cgi-bin/wiki.pl>)
  • wiki-toolkit-formatter-usemod/trunk/lib/Wiki/Toolkit/Formatter/UseMod.pm

    r146 r239  
    1 package CGI::Wiki::Formatter::UseMod;
     1package Wiki::Toolkit::Formatter::UseMod;
    22
    33use strict;
     
    1313=head1 NAME
    1414
    15 CGI::Wiki::Formatter::UseMod - UseModWiki-style formatting for CGI::Wiki
     15Wiki::Toolkit::Formatter::UseMod - UseModWiki-style formatting for Wiki::Toolkit
    1616
    1717=head1 DESCRIPTION
    1818
    19 A formatter backend for L<CGI::Wiki> that supports UseMod-style formatting.
     19A formatter backend for L<Wiki::Toolkit> that supports UseMod-style formatting.
    2020
    2121=head1 SYNOPSIS
    2222
    23   use CGI::Wiki::Formatter::UseMod;
     23  use Wiki::Toolkit::Formatter::UseMod;
    2424
    2525  # Instantiate - see below for parameter details.
    26   my $formatter = CGI::Wiki::Formatter::UseMod->new( %config );
     26  my $formatter = Wiki::Toolkit::Formatter::UseMod->new( %config );
    2727
    2828  # Format some text.
     
    3838=item B<new>
    3939
    40   my $formatter = CGI::Wiki::Formatter::UseMod->new(
     40  my $formatter = Wiki::Toolkit::Formatter::UseMod->new(
    4141                 extended_links      => 0, # $FreeLinks
    4242                 implicit_links      => 1, # $WikiLinks
     
    228228supplied into HTML.
    229229
    230 A L<CGI::Wiki> object can be supplied as an optional second parameter.
     230A L<Wiki::Toolkit> object can be supplied as an optional second parameter.
    231231This object will be used to determine whether a linked-to node exists
    232232or not, and alter the presentation of the link accordingly. This is
    233233only really in here for use when this method is being called from
    234 within L<CGI::Wiki>.
     234within L<Wiki::Toolkit>.
    235235
    236236=cut
     
    365365
    366366C<link> should be something that would go inside your extended link
    367 delimiters.  C<wiki> is optional but should be a L<CGI::Wiki> object.
     367delimiters.  C<wiki> is optional but should be a L<Wiki::Toolkit> object.
    368368If you do supply C<wiki> then the method will be able to check whether
    369369the node exists yet or not and so will call C<< ->make_edit_link >>
     
    461461                              if $self->{_munge_node_name};
    462462                            $link = $self->_munge_spaces($link);
    463                             push @CGI::Wiki::Formatter::UseMod::_links_found,
     463                            push @Wiki::Toolkit::Formatter::UseMod::_links_found,
    464464                                                                         $link;
    465465                            return ""; # don't care about output
     
    672672and forth between node names as titles, and node names as CGI params.
    673673
    674   my $formatter = CGI::Wiki::Formatter::UseMod->new( munge_urls => 1 );
     674  my $formatter = Wiki::Toolkit::Formatter::UseMod->new( munge_urls => 1 );
    675675  my $node_param = $q->param('id') || $q->param('keywords') || "";
    676676  my $node_name = $formatter->node_param_to_node_name( $node_param );
     
    686686=over 4
    687687
    688 =item * L<CGI::Wiki>
     688=item * L<Wiki::Toolkit>
    689689
    690690=item * L<Text::WikiFormat>
  • wiki-toolkit-formatter-usemod/trunk/t/default_links.t

    r135 r239  
    11use strict;
    2 use CGI::Wiki::Formatter::UseMod;
     2use Wiki::Toolkit::Formatter::UseMod;
    33use Test::More tests => 2;
    44
     
    1111WIKITEXT
    1212
    13 my $formatter = CGI::Wiki::Formatter::UseMod->new;
     13my $formatter = Wiki::Toolkit::Formatter::UseMod->new;
    1414
    1515my $html = $formatter->format( $wikitext );
  • wiki-toolkit-formatter-usemod/trunk/t/encode-node-names.t

    r109 r239  
    11use strict;
    2 use CGI::Wiki::Formatter::UseMod;
     2use Wiki::Toolkit::Formatter::UseMod;
    33use Test::More tests => 4;
    44
    5 my $formatter = CGI::Wiki::Formatter::UseMod->new( munge_urls => 1 );
     5my $formatter = Wiki::Toolkit::Formatter::UseMod->new( munge_urls => 1 );
    66is( $formatter->node_name_to_node_param( "test page" ),
    77    "Test_Page", "->node_name_to_node_param forces ucfirst by default" );
    88
    9 $formatter = CGI::Wiki::Formatter::UseMod->new( force_ucfirst_nodes => 0,
     9$formatter = Wiki::Toolkit::Formatter::UseMod->new( force_ucfirst_nodes => 0,
    1010                                                munge_urls          => 1 );
    1111is( $formatter->node_name_to_node_param( "test page" ),
    1212    "test_page", "...but not if force_ucfirst_nodes set to 0" );
    1313
    14 $formatter = CGI::Wiki::Formatter::UseMod->new;
     14$formatter = Wiki::Toolkit::Formatter::UseMod->new;
    1515is( $formatter->node_name_to_node_param( "Home Page" ), "Home Page",
    1616    "->node_name_to_node_param does nothing if munge_urls not true" );
  • wiki-toolkit-formatter-usemod/trunk/t/linebreaks.t

    r122 r239  
    22use Test::More tests => 1;
    33
    4 use CGI::Wiki::Formatter::UseMod;
     4use Wiki::Toolkit::Formatter::UseMod;
    55
    6 my $formatter = CGI::Wiki::Formatter::UseMod->new(
     6my $formatter = Wiki::Toolkit::Formatter::UseMod->new(
    77    allowed_tags => [ qw( table tr td ) ],
    88);
  • wiki-toolkit-formatter-usemod/trunk/t/links.t

    r135 r239  
    2222             } );
    2323
    24 my $formatter = CGI::Wiki::Formatter::Kake->new(
     24my $formatter = Wiki::Toolkit::Formatter::Kake->new(
    2525    node_prefix => "/wiki/",
    2626    node_suffix => ".html",
     
    4646      "...works for external links with titles too" );
    4747
    48 package CGI::Wiki::Formatter::Kake;
    49 use base "CGI::Wiki::Formatter::UseMod";
     48package Wiki::Toolkit::Formatter::Kake;
     49use base "Wiki::Toolkit::Formatter::UseMod";
    5050
    5151sub make_edit_link {
  • wiki-toolkit-formatter-usemod/trunk/t/lists.t

    r126 r239  
    22use Test::More tests => 6;
    33
    4 use CGI::Wiki::Formatter::UseMod;
     4use Wiki::Toolkit::Formatter::UseMod;
    55
    6 my $formatter = CGI::Wiki::Formatter::UseMod->new;
     6my $formatter = Wiki::Toolkit::Formatter::UseMod->new;
    77
    88# Test unordered lists.
  • wiki-toolkit-formatter-usemod/trunk/t/macros.t

    r101 r239  
    22
    33use Test::More tests => 7;
    4 use CGI::Wiki::Formatter::UseMod;
     4use Wiki::Toolkit::Formatter::UseMod;
    55
    66my $wikitext = <<WIKITEXT;
     
    2020WIKITEXT
    2121
    22 my $formatter = CGI::Wiki::Formatter::UseMod->new(
     22my $formatter = Wiki::Toolkit::Formatter::UseMod->new(
    2323    macros => {
    2424        '@PLAIN_STRING' => "{plain string}",
     
    3333    }
    3434);
    35 isa_ok( $formatter, "CGI::Wiki::Formatter::UseMod" );
     35isa_ok( $formatter, "Wiki::Toolkit::Formatter::UseMod" );
    3636my $html = $formatter->format($wikitext);
    3737
  • wiki-toolkit-formatter-usemod/trunk/t/macros_with_wiki_passed.t

    r146 r239  
    11use strict;
    2 use CGI::Wiki;
    3 use CGI::Wiki::Formatter::UseMod;
    4 use CGI::Wiki::Setup::SQLite;
    5 use CGI::Wiki::Store::SQLite;
     2use Wiki::Toolkit;
     3use Wiki::Toolkit::Formatter::UseMod;
     4use Wiki::Toolkit::Setup::SQLite;
     5use Wiki::Toolkit::Store::SQLite;
    66use Test::More;
    77
     
    1212}
    1313
    14 eval { require CGI::Wiki; };
     14eval { require Wiki::Toolkit; };
    1515if ( $@ ) {
    16     plan skip_all => "CGI::Wiki not installed";
     16    plan skip_all => "Wiki::Toolkit not installed";
    1717    exit 0;
    1818}
     
    2323# Clear out the database from any previous runs.
    2424unlink $dbname;
    25 CGI::Wiki::Setup::SQLite::setup( { dbname => $dbname } );
     25Wiki::Toolkit::Setup::SQLite::setup( { dbname => $dbname } );
    2626
    2727my $wikitext = "\@INDEX_LINK [[Category Foo]]";
    28 my $formatter = CGI::Wiki::Formatter::UseMod->new(
     28my $formatter = Wiki::Toolkit::Formatter::UseMod->new(
    2929    extended_links      => 1,
    3030    macros              => {
     
    5252);
    5353
    54 isa_ok( $formatter, "CGI::Wiki::Formatter::UseMod" );
     54isa_ok( $formatter, "Wiki::Toolkit::Formatter::UseMod" );
    5555
    56 my $store = CGI::Wiki::Store::SQLite->new( dbname => $dbname );
    57 my $wiki = CGI::Wiki->new(
     56my $store = Wiki::Toolkit::Store::SQLite->new( dbname => $dbname );
     57my $wiki = Wiki::Toolkit->new(
    5858                           formatter => $formatter,
    5959                           store     => $store,
  • wiki-toolkit-formatter-usemod/trunk/t/munge_node_name.t

    r128 r239  
    11use strict;
    22use Test::More tests => 3;
    3 use CGI::Wiki::Formatter::UseMod;
     3use Wiki::Toolkit::Formatter::UseMod;
    44
    5 eval { require CGI::Wiki; require DBD::SQLite; };
     5eval { require Wiki::Toolkit; require DBD::SQLite; };
    66my $test_wiki_available = $@ ? 0 : 1;
    77
    88SKIP: {
    9     skip "Either CGI::Wiki or DBD::SQLite not installed", 2
     9    skip "Either Wiki::Toolkit or DBD::SQLite not installed", 2
    1010      unless $test_wiki_available;
    1111
    1212    my $dbname = "./t/sqlite.db";
    13     require CGI::Wiki::Setup::SQLite; require CGI::Wiki::Store::SQLite;
    14     CGI::Wiki::Setup::SQLite::cleardb( $dbname );
    15     CGI::Wiki::Setup::SQLite::setup( $dbname );
    16     my $store = CGI::Wiki::Store::SQLite->new( dbname => $dbname );
    17     my $wiki = CGI::Wiki->new( store => $store );
     13    require Wiki::Toolkit::Setup::SQLite; require Wiki::Toolkit::Store::SQLite;
     14    Wiki::Toolkit::Setup::SQLite::cleardb( $dbname );
     15    Wiki::Toolkit::Setup::SQLite::setup( $dbname );
     16    my $store = Wiki::Toolkit::Store::SQLite->new( dbname => $dbname );
     17    my $wiki = Wiki::Toolkit->new( store => $store );
    1818    $wiki->write_node( "A state51 Node That Exists", "foo" )
    1919      or die "Can't write test node";
     
    2727WIKITEXT
    2828
    29     my $formatter = CGI::Wiki::Formatter::UseMod->new(
     29    my $formatter = Wiki::Toolkit::Formatter::UseMod->new(
    3030        extended_links  => 1,
    3131        munge_urls      => 1,
     
    4848
    4949
    50 my $formatter = CGI::Wiki::Formatter::UseMod->new(
     50my $formatter = Wiki::Toolkit::Formatter::UseMod->new(
    5151    extended_links  => 1,
    5252    munge_urls      => 1,
  • wiki-toolkit-formatter-usemod/trunk/t/node-suffix.t

    r121 r239  
    11use strict;
    22use Test::More tests => 2;
    3 use CGI::Wiki::Formatter::UseMod;
     3use Wiki::Toolkit::Formatter::UseMod;
    44use Test::MockObject;
    55
     
    1919             } );
    2020
    21 my $formatter = CGI::Wiki::Formatter::UseMod->new(
     21my $formatter = Wiki::Toolkit::Formatter::UseMod->new(
    2222    node_prefix => "/wiki/",
    2323    node_suffix => ".html",
  • wiki-toolkit-formatter-usemod/trunk/t/paragraphs.t

    r123 r239  
    22use Test::More tests => 2;
    33
    4 use CGI::Wiki::Formatter::UseMod;
     4use Wiki::Toolkit::Formatter::UseMod;
    55
    6 my $formatter = CGI::Wiki::Formatter::UseMod->new;
     6my $formatter = Wiki::Toolkit::Formatter::UseMod->new;
    77
    88# The CGI linebreak is \r\n, not \n.
  • wiki-toolkit-formatter-usemod/trunk/t/tables.t

    r138 r239  
    11use strict;
    2 use CGI::Wiki::Formatter::UseMod;
     2use Wiki::Toolkit::Formatter::UseMod;
    33use Test::More tests => 8;
    44
     
    1010WIKITEXT
    1111
    12 my $formatter = CGI::Wiki::Formatter::UseMod->new;
     12my $formatter = Wiki::Toolkit::Formatter::UseMod->new;
    1313
    1414my $html = $formatter->format( $wikitext );
  • wiki-toolkit-formatter-usemod/trunk/t/twf-bug.t

    r114 r239  
    11use strict;
    22use Test::More tests => 1;
    3 use CGI::Wiki::Formatter::UseMod;
     3use Wiki::Toolkit::Formatter::UseMod;
    44
    5 my $formatter = CGI::Wiki::Formatter::UseMod->new;
     5my $formatter = Wiki::Toolkit::Formatter::UseMod->new;
    66
    77my $foo = "x";
  • wiki-toolkit-formatter-usemod/trunk/t/usemod.t

    r133 r239  
    55use Test::MockObject;
    66
    7 use_ok( "CGI::Wiki::Formatter::UseMod" );
     7use_ok( "Wiki::Toolkit::Formatter::UseMod" );
    88
    99print "#\n#### Testing default configuration\n#\n";
     
    3131WIKITEXT
    3232
    33 my $formatter = CGI::Wiki::Formatter::UseMod->new;
    34 isa_ok( $formatter, "CGI::Wiki::Formatter::UseMod" );
     33my $formatter = Wiki::Toolkit::Formatter::UseMod->new;
     34isa_ok( $formatter, "Wiki::Toolkit::Formatter::UseMod" );
    3535my $html = $formatter->format($wikitext);
    3636
     
    6262WIKITEXT
    6363
    64 $formatter = CGI::Wiki::Formatter::UseMod->new;
     64$formatter = Wiki::Toolkit::Formatter::UseMod->new;
    6565$html = $formatter->format($wikitext);
    6666like( $html, qr|&pound;|, "Entities preserved by default." );
    6767unlike( $html, qr|<strike>|, "HTML tags escaped by default" );
    6868
    69 $formatter = CGI::Wiki::Formatter::UseMod->new( allowed_tags => [ "strike" ] );
     69$formatter = Wiki::Toolkit::Formatter::UseMod->new( allowed_tags => [ "strike" ] );
    7070$html = $formatter->format($wikitext);
    7171like( $html, qr|<strike>|, "...but not when we allow them" );
     
    101101
    102102# Test with munged URLs.
    103 $formatter = CGI::Wiki::Formatter::UseMod->new( extended_links => 1,
     103$formatter = Wiki::Toolkit::Formatter::UseMod->new( extended_links => 1,
    104104                                                munge_urls     => 1 );
    105105$html = $formatter->format($wikitext, $wiki);
     
    117117
    118118# Test with unmunged URLs.
    119 $formatter = CGI::Wiki::Formatter::UseMod->new( extended_links => 1 );
     119$formatter = Wiki::Toolkit::Formatter::UseMod->new( extended_links => 1 );
    120120$html = $formatter->format($wikitext, $wiki);
    121121
Note: See TracChangeset for help on using the changeset viewer.