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.

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

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