in reply to Re^3: Request for Perl 6 links (code)
in thread Request for Perl 6 links

In practice I've never felt the urge to link to the apocalypses or exegeses. If you want to explain the language to somebody, or implement it, the synopsis are by far the more important documents. So I think that's not a pressing issue.

The line anchors match #line_(\d+).

The section anchors are a bit more tricky, I tried to track how they are generated. The POD is parsed by smartlinks.pl, the HTML generated by Pod::Simple::HTML.

There the line anchors are piped through section_name_tidy, which is defined as follows:

sub section_name_tidy { my($self, $section) = @_; $section =~ tr/ /_/; $section =~ tr/\x00-\x1F\x80-\x9F//d if 'A' eq chr(65); # drop crazy + characters $section = $self->unicode_escape_url($section); $section = '_' unless length $section; return $section; } # and sub unicode_escape_url { my($self, $string) = @_; $string =~ s/([^\x00-\xFF])/'('.ord($1).')'/eg; # Turn char 1234 into "(1234)" return $string; }

I haven't found the place yet where whitespaces are substituted by underscores :(, but doing that the operations above, followed by a normal url encode should be sufficient. Hopefully.

Replies are listed 'Best First'.
Re^5: Request for Perl 6 links (code)
by tye (Sage) on Aug 07, 2007 at 16:48 UTC

    And the apocs and exegs don't have line number anchors. Which leans things more towards having separate synop://, apoc://, and exeg://, except that such would just add more confusion to how to use the canonical "S03" abbreviations.

    So nevermind that idea. We'll just support [aes://A01:121] under the assumption that as soon as someone starts using such it probably means that the particular apoc has been updated to have line-number anchors.

    I haven't found the place yet where whitespaces are substituted by underscores :(

    That would be the third line you quoted: (:

    $section =~ tr/ /_/;

    I could have sworn that I'd seen other punctuation marks turned into underscores, leading to sometimes fairly long runs of underscores, but the code you quoted doesn't appear to do that. Sorry, I've got to get back to my day job or I'd look for examples to dis/prove that.

    But, since nobody is complaining about "aes://" at this point, we can probably produce another patch (or, I hope, Corion will just update his).

    - tye