Subject: | Change request: =for pod2rst |
Date: | Thu, 12 May 2016 22:10:27 +1000 |
To: | bug-Pod-POM-View-Restructured [...] rt.cpan.org |
From: | Nicola Nye <nicolan [...] fastmail.com> |
Hi,
I've been using this Pod::POM::View::Restructured to update the
generated man and html pages for the Cyrus mail server, for some of our
included perl modules via pod2rst, and then sphinx for man/html
generation.
I noticed that currently the module only has provision for
=for pod2rst next-code-block
Is there any reason not to allow any rst-specific text through?
sub view_for {
my ($self, $node) = @_;
my $fmt = $node->format();
# print STDERR "got for: fmt='$fmt', text='" . $node->text() . "'\n";
if ($fmt eq 'pod2rst') {
my $text = $node->text();
if ($text =~ /\A\s*next-code-block\s*:\s*(\S+)/) {
my $lang = $1;
$self->{next_code_block} = $lang;
return '';
}
return "\n". $node->text() . "\n\n";
}
return $self->SUPER::view_for($node);
}
I'm a tech writer more than a programmer these days, and my Perl-fu is
weak, so I'm aware this approach may have hidden pitfalls! Advice and
amendments welcomed.
Cheers,
Nicola