Apache2-PodBrowser

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

          alt="Picture of ..."
          src="./Apache2::PodBrowser/torsten-foertsch.jpg"
          border="0">

     =end html

    If the POD file name doesn't contain a dot (".") the last path component
    is stripped off to get the directory name.

    Note that you need to write the package name again. You also need to
    either escape the semicolons as in
    "src="Apache2%3A%3APodBrowser/torsten-foertsch.jpg"" or put a "./" in
    front of the link.

    A note about the content type of linked documents. "Apache::PodBrowser"
    does not enter a new request cycle to ship these documents. So, the
    normal Apache Content-Type guessing does not take place.
    "Apache::PodBrowser" knows a few file name extensions ("png", "jpg",
    "jpeg", "gif", "js", "pdf" and "html"). For those it sends the correct
    Content-Type headers. All other documents are shipped as
    "application/octet-stream".

lib/Apache2/PodBrowser.pm  view on Meta::CPAN

      alt="Picture of ..."
      src="./Apache2::PodBrowser/torsten-foertsch.jpg"
      border="0">

 =end html

If the POD file name doesn't contain a dot (C<.>) the last path component
is stripped off to get the directory name.

Note that you need to write the package name again. You also need to
either escape the semicolons as in
C<src="Apache2%3A%3APodBrowser/torsten-foertsch.jpg"> or put a C<./>
in front of the link.

A note about the content type of linked documents. C<Apache::PodBrowser>
does not enter a new request cycle to ship these documents. So, the normal
Apache Content-Type guessing does not take place. C<Apache::PodBrowser> knows
a few file name extensions (C<png>, C<jpg>, C<jpeg>, C<gif>, C<js>,
C<pdf> and C<html>). For those it sends the correct Content-Type headers.
All other documents are shipped as C<application/octet-stream>.

t/001.t  view on Meta::CPAN

is $resp->code, 302, 'redirect code';

$resp=GET_BODY("/perldoc/");

# <a href="perlfunc" title="perlfunc">perlfunc</a>
like $resp, qr!<a href="\./perlpod" title="perlpod">perlpod</a>!,
    'POD Index: found perlpod';
unlike $resp, qr!href="\./"!, 'POD Index: no "Pod Index" link';
like $resp, qr!href="\./\?\?"!, 'POD Index: "Function Index" link';

# this test also covers unescaped colons in title=...
# <a href="./d::p" title="d::p">d::p</a>
like $resp, qr!<a href="\./d::p" title="d::p">d::p</a>!,
    'POD Index: found d::p (probably found in PODDIR)';

##########################################
# Function index
##########################################
t_debug 'Testing Function index';

$resp=GET("/perldoc??");     # expect redirect

t/001.t  view on Meta::CPAN

# POD index / NOINC
##########################################
t_debug 'Testing POD/Function index with NOINC';

$resp=GET_BODY("/NOINC/");

unlike $resp, qr!perlpod!, 'POD Index: perlpod not found';
unlike $resp, qr!href="\./"!, 'POD Index: no "Pod Index" link';
like $resp, qr!href="\./\?\?"!, 'POD Index: "Function Index" link';

# this test also covers unescaped colons in title=...
# <a href="./d::p" title="d::p">d::p</a>
like $resp, qr!<a href="\./d::p" title="d::p">d::p</a>!,
    'POD Index: but found d::p';

$resp=GET_BODY("/NOINC/??");

like $resp, qr!<a href="\./\?\$_" title="\$_">\$_</a>!,
    'Function Index: found $_';
like $resp, qr!<a href="\./\?ref" title="ref">ref</a>!,
    'Function Index: found ref';



( run in 0.414 second using v1.01-cache-2.11-cpan-c21f80fb71c )