Changeset 12608 for docs/Perl6/p6doc

Show
Ignore:
Timestamp:
08/23/06 13:22:47 (2 years ago)
Author:
audreyt
Message:

* p6doc: Make it slightly more useful by allowing "p6doc s03"

as synonym to "p6doc Spec::Operator". Still need a lot of
usability work before this can be released to CPAN to replace
Perl6::Bible.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • docs/Perl6/p6doc

    r9152 r12608  
    44use Pod::Perldoc; 
    55 
     6my %Spec = qw( 
     7    1 Overview 2 Syntax       3 Operator     4 Block 
     8    5 Rule     6 Subroutine   9 Structure    10 Package 
     9    11 Module 12 Object      13 Overload 
     10 
     11    17 Concurrency 
     12    22 CPAN 
     13    26 Documentation 
     14    29 Functions 
     15); 
     16 
    617my $doc = shift || 'doc'; 
    7 $doc = "Perl6::\L\u$doc"; 
     18if ($doc =~ /^S?0*(\d+)/i) { 
     19    $doc = "Perl6::Spec::$Spec{$1}"; 
     20} 
     21else { 
     22    # XXX - Be more like "ri" and allow introspection over API etc 
     23    $doc = "Perl6::\L\u$doc"; 
     24} 
    825@ARGV = $doc; 
    926