| 1 | ## | ||||||||||
| 2 | # name: Stardoc::Kwim | ||||||||||
| 3 | # abstract: Stardoc Kwim Module | ||||||||||
| 4 | # author: Ingy döt Net <ingy@cpan.org> | ||||||||||
| 5 | # license: perl | ||||||||||
| 6 | # copyright: 2011 | ||||||||||
| 7 | |||||||||||
| 8 | # XXX Remove this early dep on WikiText. | ||||||||||
| 9 | |||||||||||
| 10 | 1 | ▶ | use 5.008003; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | package Stardoc::Kwim; | ||||||||||
| 12 | 1 | ▶ | use WikiText 0.15 (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | 1 | ▶ | use base 'WikiText'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | |||||||||||
| 15 | 1 | our $VERSION = '0.01'; | |||||||||
| 16 | |||||||||||
| 17 | 0 | ▶ | sub to_html { | ||||||||
|
Subroutine
to_html: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||
| 18 | 0 | my $self = shift; | |||||||||
| 19 | 0 | my $parser_class = ref($self) . '::Parser'; | |||||||||
| 20 | 0 | ▶ | eval "require $parser_class; 1" | ||||||||
|
Branch: 1 branch
| |||||||||||
| 21 | or die "Can't load $parser_class:\n$@"; | ||||||||||
| 22 | 0 | require WikiText::HTML::Emitter; | |||||||||
| 23 | 0 | my $parser = $parser_class->new( | |||||||||
| 24 | receiver => WikiText::HTML::Emitter->new(break_lines => 1), | ||||||||||
| 25 | ); | ||||||||||
| 26 | |||||||||||
| 27 | 0 | return $parser->parse($self->{wikitext}); | |||||||||
| 28 | } | ||||||||||
| 29 | |||||||||||
| 30 | 1 | 1; | |||||||||
| 31 | |||||||||||
| 32 | =head1 SYNOPSIS | ||||||||||
| 33 | |||||||||||
| 34 | use Stardoc::Kwim; | ||||||||||
| 35 | |||||||||||
| 36 | my $html = Stardoc::Kwim->new($kwim)->to_html; | ||||||||||
| 37 | |||||||||||
| 38 | =head1 DESCRIPTION | ||||||||||
| 39 | |||||||||||
| 40 | This module can convert Kwim markup to HTML. | ||||||||||