Changeset 16740 for docs/Perl6/Spec

Show
Ignore:
Timestamp:
06/26/07 18:35:43 (17 months ago)
Author:
diakopter
Message:

re-syncing from Perl6-Perldoc-v0.0.5

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • docs/Perl6/Spec/Documentation.pod

    r16035 r16740  
    2121    Maintainer:     Damian Conway 
    2222    Date:           9 Apr 2005 
    23     Last Modified:  19 Feb 2007 
     23    Last Modified:  25 Apr 2007 
    2424 
    2525 
     
    9898After the typename, the rest of the C<=begin> marker line is treated as 
    9999configuration information for the block. This information is used in 
    100 different ways by different types of blocks, and is specified using 
    101 Perl6ish C<:key<value>> or C<< key=>value >> pairs (which must, of 
    102 course, be constants since Perldoc is a specification language, not a 
    103 programming language). 
     100different ways by different types of blocks, but is always specified using 
     101Perl6-ish option pairs. That is, any of: 
     102 
     103=for table :nested 
     104  Value is...      Specify with...      Or with...      Or with... 
     105  ===============  ==================   ==============  ====================== 
     106  Boolean (true)   C�:key�              C�:key(1)�      C�key => 1� 
     107  Boolean (false)  C�:!key�             C�:key(0)�      C�key => 0� 
     108  String           C�:key<str>�         C�:key('str')�  C�key => 'str'�  
     109  List             C�:key<1 2 3>�       C�:key[1,2,3]�  C�key => [1,2,3]�  
     110  Hash             C�:key{a=>1, b=>2}�                  C�key => {a=>1, b=>2}�  
     111  Code             C�:key{ sqrt($_) }� 
     112    
     113All option keys and values must, of course, be constants since Perldoc 
     114is a specification language, not a programming language. 
    104115See L<Synopsis 2|http://dev.perl.org/perl6/doc/design/syn/S02.html#Literals> 
    105 for a summary of the Perl 6 pair notation. 
     116for details of the various Perl 6 pair notations. 
    106117 
    107118The configuration section may be extended over subsequent lines by 
     
    109120whitespace character. 
    110121 
    111 The lines following the opening delimiter and configuration are the data 
    112 or contents of the block, which continue until the block's C<=end> marker 
    113 line. The general syntax is: 
     122The lines following the opening delimiter and configuration are the 
     123data or contents of the block, which continue until the block's C<=end> 
     124marker line. For most block types, these contents may be indented if you 
     125wish, without them being treated as L<code blocks|#Code blocks>. Unlike 
     126Perl 5, indented text is only treated as code within C<=pod>, 
     127L<C<=nested>|#Nesting blocks>, L<C<=item>|#Lists>, C<=code>, and 
     128L<semantic|#Semantic blocks> blocks. 
     129 
     130The general syntax is: 
    114131 
    115132=begin code :allow< R > 
     
    255272 
    256273    =begin para :nested 
    257     =begin para   :nested 
    258     =begin para     :nested 
     274    =begin para :nested 
     275    =begin para :nested 
    259276    "We're going deep, deep, I<deep> undercover!" 
    260277    =end para 
     
    501518    =head2 This is another heading block 
    502519 
    503 Within a C<=pod>, C<=item>, C<=nested>, or C<=END> block, ordinary 
    504 paragraphs do not require an explicit marker or delimiters, but there is 
    505 also an explicit C<para> marker (which may be used anywhere): 
     520Within a C<=pod>, C<=item>, C<=nested>, C<=END>, or 
     521L<semantic|#Semantic blocks> block, ordinary paragraphs do not require 
     522an explicit marker or delimiters, but there is also an explicit C<para> 
     523marker (which may be used anywhere): 
    506524 
    507525=for code :allow<B> 
     
    513531and likewise the longer C<=for> and C<=begin>/C<=end> forms. For example: 
    514532 
    515 =for code :allow<B> 
     533=begin code :allow<B> 
    516534     B<=begin para> 
    517535         This is an ordinary paragraph. 
    518536         Its text  will   be     squeezed     and 
    519537         short lines filled. 
     538 
     539         This is I<still> part of the same paragraph, 
     540         which continues until an... 
    520541     B<=end para> 
     542=end code 
    521543 
    522544As the previous example implies, when any form of explicit C<para> block 
    523545is used, any whitespace at the start of each line is removed, so 
    524 the paragraph text no longer has to begin at column 1. 
     546the paragraph text no longer has to begin at column 1. In addition, 
     547within a delimited C<=begin para>/C<=end para> block, any blank lines are 
     548preserved. 
    525549 
    526550 
     
    547571 
    548572Implicit code blocks may only be used within C<=pod>, C<=item>, 
    549 C<=nested>, or C<=END> blocks. 
     573C<=nested>, C<=END>, or L<semantic|#Semantic blocks> blocks. 
    550574 
    551575There is also an explicit C<=code> block (which can be specified within 
     
    640664 
    641665Unlike C<=code> blocks, both C<=input> and C<=output> blocks honour any 
    642 nested formatting codes. This is particular useful since a sample of 
     666nested formatting codes. This is particularly useful since a sample of 
    643667input will often include prompts (which are, of course, output). 
    644668Likewise a sample of output may contain the occasional interactive