File: link

package info (click to toggle)
libtemplate-perl 2.14-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, sarge
  • size: 5,496 kB
  • ctags: 667
  • sloc: perl: 15,349; makefile: 62; xml: 7; sh: 5
file content (22 lines) | stat: -rw-r--r-- 775 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
[%  DEFAULT text = link;
    UNLESS link.search('^http:');
	# L<foo/bar>  => ../../docset.link.foo/#bar	# TT link
	# L<Foo::Bar> => http://search.cpan.org/...	# not a TT link
        links = link.split('/');
	link  = links.0;
	sec   = links.1.replace('\W+', '_');
	sec   = sec ? "#$sec" : '';
	IF (href = docset.links.$link); 
	    link = "$page.uplink/$href$sec";
	ELSIF link.search('::') or docset.cpan.$link;
            link = link.replace('^CPAN::', '');    # hack to force CPAN lookup
	    text = text.replace('^CPAN::', '');
	    link = link.replace(':', '%3A');	   # should use HTTP escape
	    link = "http://search.cpan.org/search?mode=module&query=$link";
	ELSE;
	    link = link.replace('\W+', '_');
	    link = "#$link";
	END;
    END;
    PROCESS html/link;
-%]