Skip Menu |

This queue is for tickets about the Pod-POM-View-Restructured CPAN distribution.

Report information
The Basics
Id: 114346
Status: resolved
Priority: 0/
Queue: Pod-POM-View-Restructured

People
Owner: alexm [...] cpan.org
Requestors: nicolan [...] fastmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.01
Fixed in: 0.04



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
Hi Nicola! I can't see what you're trying to achieve. Could you provide any example to illustrate the feature you'd like to have? Thanks a lot, Alex
Subject: Re: [rt.cpan.org #114346] Change request: =for pod2rst
Date: Tue, 13 Dec 2016 12:52:24 +1100
To: Alex Muntada via RT <bug-Pod-POM-View-Restructured [...] rt.cpan.org>
From: Nicola Nye <nicolan [...] fastmail.com>
Hi Alex! So in my perl source file I have some snippets like: Show quoted text
> =for pod2rst .. DO NOT EDIT cyradm.rst: Autogenerated
Show quoted text
>
Show quoted text
> =for pod2rst .. cyrusman:: cyradm(8)
Show quoted text
>
Show quoted text
> =for pod2rst .. _imap-reference-manpages-systemcommands-cyradm:
Show quoted text
>
Show quoted text
> =head1 NAME
Show quoted text
>
Show quoted text
> Cyrus::IMAP::Shell - Perl version of cyradm
I use this to inject information that the sphinx compiler uses to make the file available for cross-linking, and to warn people that the rst file is autogenerated, so they shouldn't try editing it! Then at the end, there's: Show quoted text
> =head1 SEE ALSO
Show quoted text
>
Show quoted text
> Cyrus::IMAP::Admin,
Show quoted text
> Term::ReadLine,
Show quoted text
> sh(1), perl(1), imapd(8), imapd.conf(5), reconstruct(8)
Show quoted text
>
Show quoted text
> =for pod2rst :cyrusman:`imapd(8)`, :cyrusman:`imapd.conf(5)`, > :cyrusman:`reconstruct(8)`.
Again, provided to allow for cross-linking to other files (which are internal man pages) Hope this helps you understand what I'm trying to achieve. Cheers, Nicola
Hi Nicola! I think it's a good idea to relax that restriction so any rst text is allowed. Thanks for the examples! Alex