CGI-Kwiki

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

        pages_class:       CGI::Kwiki::Pages
        slides_class:      CGI::Kwiki::Slides
        javascript_class:  CGI::Kwiki::Javascript
        style_class:       CGI::Kwiki::Style
        scripts_class:     CGI::Kwiki::Scripts

    This is a list of all the classes that make up the kwiki. You can change
    anyone of them to be a class of your own.

    Let's say that you wanted to change the BOLD format indicator from
    "*bold*" to '''bold'''. You just need to override the "bold()" method of
    the Formatter class. Start by changing "config.yaml".

        formatter_class: MyKwikiFormatter

    Then write a module called "MyKwikiFormatter.pm". You can put this
    module right in your kwiki installation directory if you want. The
    module might look like this:

        package MyKwikiFormatter;
        use base 'CGI::Kwiki::Formatter';

        sub bold {
            my ($self, $text) = @_;
            $text =~ s!'''(.*?)'''!<b>$1</b>!g;
            return $text;
        }

        1;

    Not too hard, eh? You can change all aspects of CGI::Kwiki like this,
    from the database storage to the search engine, to the main driver code.
    If you come up with a set of classes that you want to share with the

lib/CGI/Kwiki.pm  view on Meta::CPAN

    pages_class:       CGI::Kwiki::Pages
    slides_class:      CGI::Kwiki::Slides
    javascript_class:  CGI::Kwiki::Javascript
    style_class:       CGI::Kwiki::Style
    scripts_class:     CGI::Kwiki::Scripts

This is a list of all the classes that make up the kwiki. You can change
anyone of them to be a class of your own.

Let's say that you wanted to change the B<BOLD> format indicator from
C<*bold*> to C<'''bold'''>. You just need to override the C<bold()>
method of the Formatter class. Start by changing C<config.yaml>.

    formatter_class: MyKwikiFormatter

Then write a module called C<MyKwikiFormatter.pm>. You can put this
module right in your kwiki installation directory if you want. The
module might look like this:

    package MyKwikiFormatter;
    use base 'CGI::Kwiki::Formatter';

    sub bold {
        my ($self, $text) = @_;
        $text =~ s!'''(.*?)'''!<b>$1</b>!g;
        return $text;
    }

    1;

Not too hard, eh? You can change all aspects of CGI::Kwiki like this,
from the database storage to the search engine, to the main driver code.
If you come up with a set of classes that you want to share with the

lib/CGI/Kwiki/Formatter.pm  view on Meta::CPAN

    return qw(
        table code function 
        header_1 header_2 header_3 header_4 header_5 header_6 
        escape_html
        lists comment horizontal_line
        paragraph 
        named_http_link no_http_link http_link
        no_mailto_link mailto_link
        no_wiki_link force_wiki_link wiki_link
        inline version negation
        bold italic underscore
    );
}

my $slide_num;
sub process {
    $slide_num = 0;
    my ($self, $wiki_text) = @_;
    my $array = [];
    push @$array, $wiki_text;
    for my $method ($self->process_order) {

lib/CGI/Kwiki/Formatter.pm  view on Meta::CPAN

    $text =~ s{\\ ([ \[\] ]) }{$1}xg;   # Translate \] escapes to ]
    "<code>$text</code>";
}

sub negation {
    my ($self, $text) = @_;
    $text =~ s#\!(?=\[)##g;
    return $text;
}

sub bold {
    my ($self, $text) = @_;
    $text =~ s#(?<![$WORD])\*(\S.*?\S|\S)\*(?![$WORD])#<b>$1</b>#g;
    return $text;
}

sub italic {
    my ($self, $text) = @_;
    $text =~ s#(?<![$WORD<])/(\S.*?\S|\S)/(?![$WORD])#<em>$1</em>#g;
    return $text;
}

lib/CGI/Kwiki/Pages.pm  view on Meta::CPAN

----
Paragraphs are separated by a blank line.

Like this. Another paragraph.
  Paragraphs are separated by a blank line.

  Like this. Another paragraph.
----
*Bold text*, /italic text/, and _underscore text_.
  *Bold text*, /italic text/, and _underscore text_.
/*Combination of bold and italics*/
  /*Combination of bold and italics*/
Inline code like [=/etc/passwd] or [=CGI::Kwiki]
  Inline code like [=/etc/passwd] or [=CGI::Kwiki]
----
WikiLinks are formed by two or more words in /camel-case/.
  WikiLinks are formed by two or more words in /camel-case/.
External links begin with http://, like http://www.freepan.org
  External links begin with http://, like http://www.freepan.org
Forced wiki [links] are a alphnumeric string surrounded by square brackets.
  Forced wiki [links] are a alphnumeric string surrounded by square brackets.
Named http links have text with an http:// link inside, like [FreePAN http://www.freepan.org Site]

lib/CGI/Kwiki/Style.pm  view on Meta::CPAN

=cut

__Klassik__
body {
    background:#FFF;        
}

h1, h2, h3 {
    margin: 0px;
    padding: 0px;
    font-weight: bold;
}

#banner {
    width: 10%;
    float: left;
    font-size:x-large;
    font-weight:bold;
    background:#FFF;
}
    
#banner h1 { display: none; }
            
#content {
    float:left;
    width:510px;
    background:#FFF;
    margin-bottom:20px;



( run in 1.320 second using v1.01-cache-2.11-cpan-5dc5da66d9d )