\s+ (.*) $/ { self.end_pod; self.set_title($0.Str); next; } if $row ~~ m/^ \=(head<[12345]>) \s+ (.*) $/ { self.end_pod; self.head($0.Str, $1.Str); next; } # TODO implement the following tags: if $row ~~ m/^\=over \s+ (\d+) \s* $/ { self.over($0.Str); next; } if $row ~~ m/^\=item \s+ (.*) $/ { self.item($0.Str); next; } if $row ~~ m/^\=back\s*/ { self.back; next; } if $row ~~ m/^\=begin\s+code\s*$/ { next; } if $row ~~ m/^\=end\s+code\s*$/ { next; }
NAME
Pod::Parser - parsing files with POD in them (Perl 6 syntax)
WARNING
The generated data structure is not final yet
use Pod::Parser;
my $pp = Pod::Parser.new;
my @data = $pp.parse_file('path/to/file.pod');
or
my $pod = 'path/to/file.pod'.IO.slurp;
my @data = $pp.parse($pod);
Example
use Pod::Parser;
my $pp = Pod::Parser.new;
my @data = $pp.parse_file('path/to/file.pod');
CATCH {
when X::Pod::Parser {
warn $_;
return;
}
}