Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: pod2html: link (L<...>) formatting code

by haj (Vicar)
on Dec 14, 2021 at 14:07 UTC ( [id://11139610]=note: print w/replies, xml ) Need Help??


in reply to pod2html: link (L<...>) formatting code

Unfortunately, pod2html does not work like this. You only get links for stuff where pod2html is able to locate a POD source, where it assumes that the POD sources and the resulting HTML tree have the same directory layout. Only when pod2html is able to locate a source, it will prepend htmlroot (after stripping podroot).

You can add --verbose to see pod2html complain that it left the links unresolved.

I guess that the MetaCPAN POD renderer has its own Pod-to-HTML converter. Probably the place to hook into is sub resolve_pod_page_link in Pod::HTML.

Replies are listed 'Best First'.
Re^2: pod2html: link (L<...>) formatting code
by kcott (Archbishop) on Dec 15, 2021 at 02:52 UTC

    G'day haj,

    ++ Many thanks for your reply.

    "Unfortunately, pod2html does not work like this. ..."

    I think that explains my earlier statement: "I feel like I'm missing something obvious, but have no idea what that might be."

    I didn't realise that I needed --verbose to display warning messages. I did try it and sure enough:

    ... Cannot find file "perlpod.*" directly under podpath, cannot find suita +ble replacement: link remains unresolved. Cannot find file "strict.*" directly under podpath, cannot find suitab +le replacement: link remains unresolved. Cannot find file "Getopt/Long.*" directly under podpath, cannot find s +uitable replacement: link remains unresolved. Cannot find file "Text/CSV.*" directly under podpath, cannot find suit +able replacement: link remains unresolved.

    Based on that, I tried adding '--podpath=`perl -e 'print join ":", @INC'` --recurse'. This did produce links with href= values like "/path/to/name.html"; however, none of those name.html files existed — there were equivalent name.pod or name.pm files at the /path/to/ locations.

    That may be worth pursuing, or perhaps your suggestion of "hook into sub resolve_pod_page_link" would be a better option. Anyway, that's got me further along than I was before, so thanks again.

    — Ken

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11139610]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-03-29 01:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found