in reply to Adding "podpath" to Pod::XHTML?
I like Pod::XHTML because I get better control of the output formatting, but I really want the "--podpath" kind of searching in Pod::Html. Is this feasible? Assuming I know nothing about subclassing? (BTW, this is for https://www.openssl.org/docs/manpages )
What?
What is your actual ultimate goal? Combine wrap pod2html in a perl script and Adding "podpath" to Pod::XHTML? a picture is starting to form, but the details are peculiar, can you clarify them?
Does this help you in any way?
get '/mods/doc/:modname' => sub { my %params = params; my $ruri = request->request_uri(); if( $ruri =~ s/%3A/:/g ) { ## workaround for Pod::Simple::HTML , I prefer : over %3A ## and I preserve the rest http://localhost/mods/doc/Dancer%3A%3AReque +s%74 return redirect( $ruri ); } my $ret = eval { modlist::pod2html( %params ) }; if( !defined $ret or !length $ret ) { return meta_redirect( params, redirect => uri_for( "/mods" ) ) +; } return cache_page $ret; }; sub modlist::pod2html { my %opts = @_; my $module = $opts{modname}; my $modfile = $INC{$module}; $modfile ||= do { use Config(); use Pod::Find(); Pod::Find::pod_where( { -inc => 1, -script => 1, -perl => 1, -dirs => [ @INC, grep { defined and length } @Config::Config{ qw' installsitebin installsitescript installvendorbin installvendorscript installbin installscript ' } ], }, $module ); }; use Pod::Simple::XHTML; my $pshtml = Pod::Simple::XHTML->new; $pshtml->index( 1 ); $pshtml->html_css( 'http://search.cpan.org/s/style.css' ); $pshtml->perldoc_url_prefix( '' ); $pshtml->perldoc_url_postfix( '' ); $pshtml->man_url_prefix( 'http://man.linuxquestions.org/index.php?type=2&query=' ); $pshtml->man_url_postfix( '' ); my $somestring = ""; $pshtml->output_string( \$somestring ); $pshtml->parse_file( $modfile ); return $somestring; } ## end sub modlist::pod2html
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Adding "podpath" to Pod::XHTML?
by rsalz (Initiate) on Aug 20, 2015 at 01:56 UTC | |
by Anonymous Monk on Aug 20, 2015 at 04:34 UTC | |
by rsalz (Initiate) on Aug 25, 2015 at 03:01 UTC | |
by rsalz (Initiate) on Aug 25, 2015 at 21:46 UTC | |
by Anonymous Monk on Aug 26, 2015 at 01:06 UTC |