The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Mediawiki::POD::HTML - a subclass to catch X keywords and =head lines

SYNOPSIS

        use Mediawiki::POD::HTML;
        
        my $parser = Mediawiki::POD::HTML->new();

        my $html = $parser->parse_string_document($POD);

DESCRIPTION

Turns a given POD (Plain Old Documentation) into HTML code.

This subclass of Pod::Simple::HTML catches =head directives, and then allows you to assemble a TOC (table of contents) from the captured headlines.

In addition, it supports graph-common and graph subsections, these will be turned into HTML graphs.

GRAPH SUPPORT

Mediawiki::POD::HTML allows you to write graphs (nodes connected with edges) in Graph::Easy or http://www.graphviz.org|Graphviz format and turns these portions into HTML "graphics".

The following represents two graphs:

        =for graph [ Single ] --> [ Line ] --> [ Definition ]

        =begin graph

        node { fill: silver; }
        [ Mutli ] --> [ Line ]

        =end graph

In addition, a graph-common section can be used to set a common text for all following graphs. Each graph-common section resets the common text section:

        =for graph-common node { fill: red; }

        =for graph [ Red ]

        =for graph [ Red too ]

        =for graph-common node { fill: blue; }

        =for graph [ Blue ]

        =for graph [ Blue too ]

The attribute output for graphs is not yet used, eventually it should result in different output formats like SVG, or PNG rendered via dot.

METHODS

get_headlines()

Return all the captured headlines as an ARRAY ref.

keyword_search_url()

        # Set external search engine to search for "Foo+Bar"
        $parser->keyword_search_url('http://search.cpan.org/perldoc?');

        # Generate URLs like "Foo_Bar", perfect for relative wiki links:
        $parser->keyword_search_url('', '_');

Get/set the URL that is used to link keywords defined with X<> to a search engine.

If the URL contains a text ##KEYWORD##, then this text will be replaced with the actual keyword. Otherwise, the keyword is simple appended to the URL.

The default search URL is:

        http://cpan.uwinnipeg.ca/search?query=##KEYWORD##

Optionally set the character that replaces a space in generated URLs. The default space replacement character is undef, this means the character is dependend on the search URL:

  • For URLS with ##KEYWORD##, it is '+'

  • For URLS without a ##KEYWORD##, it is '_'

LICENSE

This library is free software; you can redistribute it and/or modify it under the same terms of the GPL.

See the LICENSE file for information.

AUTHOR

(c) Copyright by Tels http://bloodgate.com/wiki 2007

SEE ALSO

http://bloodgate.com/wiki/POD, Graph::Easy.