perl-pod / pod-simple

Framework for Parsing and Formatting POD
http://search.cpan.org/dist/Pod-Simple/
44 stars 60 forks source link

Support for relative http/file links? #147

Open rwstauner opened 2 years ago

rwstauner commented 2 years ago

Has support ever been considered for links like <text|./some/file> ?

I received this question on Pod::Markdown https://github.com/rwstauner/Pod-Markdown/issues/23

From the context of markdown/html, it's a reasonable request.

Right now Pod::Markdown has code like this: https://github.com/rwstauner/Pod-Markdown/blob/master/lib/Pod/Markdown.pm#L1129-L1134

sub   end_L {
  my ($self) = @_;
  my $flags = pop @{ $self->_private->{link} }
    or die 'Invalid state: link end with no link start';

  my ($type, $to, $section) = @{$flags}{qw( type to section )};

The $to param from Pod::Simple is "." which makes sense based on the pod spec, but i'm not sure if that's useful.

I considered adding this code to Pod::Markdown:

  if ($to eq '.') {
    $type = 'url';
    $to = "$to/$section";
  }

and then I thought I should ask for thoughts here.