Changeset 15891 for docs/Perl6/Spec

Show
Ignore:
Timestamp:
04/12/07 18:40:52 (20 months ago)
Author:
diakopter
Message:

updated S26 to Damian's Perl6-Perldoc-v0.0.2 edition
auto XHTML conversion for spec.pugscode.org sometime...

Files:
1 modified

Legend:

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

    r14843 r15891  
    2121    Maintainer:     Damian Conway 
    2222    Date:           9 Apr 2005 
    23     Last Modified:  22 Nov 2006 
     23    Last Modified:  14 Feb 2007 
    2424 
    2525 
     
    6060would be the source code of the program that the Pod is documenting. Pod 
    6161parsers still parse this text into the internal representation of the 
    62 file (representing it as an C<Perldoc::Block::Ambient> block), but 
     62file (representing it as a C<Perldoc::Block::Ambient> block), but 
    6363renderers will usually ignore such blocks. 
    6464 
     
    145145that is either empty or that contains only whitespace characters. That 
    146146is, a blank line matches the Perl 6 pattern: C</^^ \h* $$/>. Pod uses 
    147 blank lines, rather than empty lines, as delimiters on the principle of 
     147blank lines as delimiters, rather than empty lines, the principle of 
    148148least surprise. 
    149149 
     
    279279    B<=begin code :nested(0)> 
    280280 
    281                 1          2         3         4         5         6 
     281                 1         2         3         4         5         6 
    282282        123456789012345678901234567890123456789012345678901234567890 
    283283        |------|-----------------------|---------------------------| 
     
    323323    Warning: Do not immerse in water. Do not expose to bright light. 
    324324    Do not feed after midnight. 
    325  
     325    >> 
    326326    =end para 
    327327 
     
    350350related L<configurations|#Block pre-configuration>. For example: 
    351351 
    352     =config head2  :like<head1> :formatting<I> 
     352    =config head2  :like<head1> :formatted<I> 
    353353 
    354354=end item 
     
    433433=end nested 
    434434 
    435 3: The Implementation 
     4353. The Implementation 
    436436=end nested 
    437437 
     
    479479 
    480480Ordinary paragraph blocks consist of text that is to be formatted into 
    481 a document at the currently level of nesting, with whitespace 
     481a document at the current level of nesting, with whitespace 
    482482squeezed, lines filled, and any special L<inline mark-up|#Formatting codes> 
    483483applied. 
     
    485485Ordinary paragraphs consist of one or more consecutive lines of text, 
    486486each of which starts with a non-whitespace character at column 1. The 
    487 paragraph is terminated by the first blank line or opening block 
    488 directive. For example: 
     487paragraph is terminated by the first blank line or block directive. 
     488For example: 
    489489 
    490490    =head1 This is a heading block 
     
    493493    Its text  will   be     squeezed     and 
    494494    short lines filled. It is terminated by 
    495     the first blank line 
     495    the first blank line. 
    496496 
    497497    This is another ordinary paragraph. 
    498498    Its     text    will  also be squeezed and 
    499499    short lines filled. It is terminated by 
    500     the trailing directive on the next line 
    501  
     500    the trailing directive on the next line. 
    502501    =head2 This is another heading block 
    503502 
    504 Within a C<=pod>, C<=item>, or C<=nested> block, ordinary paragraphs do not 
    505 require an explicit marker or delimiters, but there is also an explicit 
    506 C<para> marker (which may be used anywhere): 
    507  
    508      =para 
     503Within a C<=pod>, C<=item>, C<=nested>, or C<=END> block, ordinary 
     504paragraphs do not require an explicit marker or delimiters, but there is 
     505also an explicit C<para> marker (which may be used anywhere): 
     506 
     507=for code :allow<B> 
     508     B<=para> 
    509509     This is an ordinary paragraph. 
    510510     Its text  will   be     squeezed     and 
     
    513513and likewise the longer C<=for> and C<=begin>/C<=end> forms. For example: 
    514514 
    515      =begin para 
     515=for code :allow<B> 
     516     B<=begin para> 
    516517         This is an ordinary paragraph. 
    517518         Its text  will   be     squeezed     and 
    518519         short lines filled. 
    519      =end para 
     520     B<=end para> 
    520521 
    521522As the previous example implies, when any form of explicit C<para> block 
     
    557558 
    558559     sub loud_update ($who, $status) { 
    559          say "$who -> $status."; 
     560         say "$who -> $status"; 
    560561 
    561562         silent_update($who, $status); 
     
    645646(C<K<>> and C<T<>>) to indicate embedded input or output, so you can use 
    646647the block type that indicates the overall purpose of the sample (i.e. is 
    647 it demonstrating an input operation or an output sequence) and then use 
     648it demonstrating an input operation or an output sequence?) and then use 
    648649the "contrasting" formatting code within the block. 
    649650 
     
    659660 
    660661        Height:  180cm/5'11" 
    661         Weight:  105kg/230lb 
     662        Weight:  104kg/230lb 
    662663        Age:     49 
    663664 
     
    789790=end nested 
    790791 
    791 although the numbering scheme is at the discretion of the renderer, so it 
    792 might equally well be rendered: 
     792although the numbering scheme is entirely at the discretion of the 
     793renderer, so it might equally well be rendered: 
    793794 
    794795=begin nested 
     
    840841The numbering of successive C<=item1> list items increments 
    841842automatically, but is reset to 1 whenever any other kind of non-ambient 
    842 Perldoc block appears between to C<=item1> blocks. For example: 
     843Perldoc block appears between two C<=item1> blocks. For example: 
    843844 
    844845    The options are: 
     
    948949E<curren;nbsp;nbsp>'Rithmetic 
    949950 
     951As with numbering styles, the bulleting strategy used for different levels 
     952within a nested list is entirely up to the renderer. 
     953 
    950954 
    951955=head4 Multi-paragraph list items 
     
    10261030=for code :allow<B> 
    10271031    B<=begin nested> 
    1028         We are all of us in the gutter,E<NL> 
    1029         but some of us are looking at the stars! 
     1032    We are all of us in the gutter,E<NL> 
     1033    but some of us are looking at the stars! 
    10301034    B<=begin nested> 
    1031             -- Oscar Wilde 
     1035    -- Oscar Wilde 
    10321036    B<=end nested> 
    10331037    B<=end nested> 
     
    10401044 
    10411045Simple tables can be specified in Perldoc using a C<=table> block. 
    1042 The table may be given a label using the C<:caption> option. 
     1046The table may be given an associated description or title using the 
     1047C<:caption> option. 
    10431048 
    10441049Columns are separated by whitespace, vertical lines (C<|>), or border 
     
    12201225    =LICENCE 
    12211226    =LICENSE 
     1227    =TITLE 
    12221228    =SECTION 
    12231229    =CHAPTER 
     
    12491255    =begin code 
    12501256        use Perldoc::Parser 
    1251  
     1257         
    12521258        my Perldoc::Parser $parser .= new(); 
    1253  
     1259         
    12541260        my $tree = $parser.parse($fh); 
    12551261    =end code 
     
    12711277=begin code :allow< L > 
    12721278    use L<Perldoc::Parser|doc:Perldoc::Parser>; 
    1273  
     1279         
    12741280    my Perldoc::Parser $parser .= new(); 
    1275  
     1281         
    12761282    my $tree = $parser.parse($fh); 
    12771283=end code 
     
    12971303immediately by a set of angle brackets. The brackets contain the text or 
    12981304data to which the formatting code applies. You can use a set of single 
    1299 angles (C´<...>ª), a set of double angles (C<´...ª>), or multiple 
    1300 single-angles (C´<<<...>>>ª). 
     1305angles (C�<...>�), a set of double angles (C<�...�>), or multiple 
     1306single-angles (C�<<<...>>>�). 
    13011307 
    13021308Within angle delimiters, you cannot use sequences of the same angle 
     
    13071313        These are errors... 
    13081314 
    1309     C< $fooB´<<ªbarB´>>ª > 
    1310     The Perl 5 heredoc syntax was: C< B´<<ªEND_MARKER > 
     1315    C< $fooB�<<�barB�>>� > 
     1316    The Perl 5 heredoc syntax was: C< B�<<�END_MARKER > 
    13111317=end code 
    13121318 
     
    13201326 
    13211327=for code :allow<B> 
    1322     CB<´>$foo < $barB<ª> 
    1323     The Perl 5 heredoc syntax was: CB<´> <<END_MARKER B<ª> 
     1328    CB<�>$foo < $barB<�> 
     1329    The Perl 5 heredoc syntax was: CB<�> <<END_MARKER B<�> 
    13241330 
    13251331or delimiters with more consecutive angles than your text contains: 
    13261332 
    13271333=for code :allow<B> 
    1328     CB´<<ª$foo < $barB´>>ª 
    1329     The Perl 5 heredoc syntax was: CB´<<<ª <<END_MARKER B´>>>ª 
     1334    CB�<<�$foo < $barB�>>� 
     1335    The Perl 5 heredoc syntax was: CB�<<<� <<END_MARKER B�>>>� 
    13301336 
    13311337A formatting code ends at the matching closing angle bracket(s), or at 
     
    13871393output, code, and metasyntax: 
    13881394 
    1389 =item 
     1395=begin item 
    13901396The C<T<>> formatting code specifies that the contained text is 
    13911397B<terminal output>; that is: something that a program might print out. 
    1392 Such content would typically be rendered in a T<fixed-width font>. The 
    1393 contents of a C<T<>> code are always L<space-preserved | 
    1394 #Space-preserving text> (as if they had an implicit C<S<...>> around them). 
    1395 The C<T<>> code is the inline equivalent of the C<=output> block. 
    1396  
    1397 =item 
     1398Such content would typically be rendered in a T<fixed-width font> or with 
     1399C< <code>...</code> > tags. The contents of a C<T<>> code are always 
     1400L<space-preserved | #Space-preserving text> (as if they had an implicit 
     1401C<S<...>> around them). The C<T<>> code is the inline equivalent of the 
     1402C<=output> block. 
     1403=end item 
     1404 
     1405=begin item 
    13981406The C<K<>> formatting code specifies that the contained text is 
    13991407B<keyboard input>; that is: something that a user might type in. Such 
    1400 content would typically be rendered in a K<fixed-width font>, preferably a 
    1401 different font from that used for the C<T<>> formatting code. The 
    1402 contents of a C<K<>> code are always L<space-preserved| 
    1403 #Space-preserving text>. The C<K<>> code is the inline equivalent of the 
    1404 C<=input> block. 
     1408content would typically be rendered in a K<fixed-width font> (preferably a 
     1409different font from that used for the C<T<>> formatting code) or with 
     1410C< <kbd>...</kbd> > tags. The contents of a C<K<>> code are always 
     1411L<space-preserved| #Space-preserving text>. The C<K<>> code is the 
     1412inline equivalent of the C<=input> block. 
     1413=end item 
    14051414 
    14061415=begin item 
    14071416The C<C<>> formatting code specifies that the contained text is B<code>; 
    14081417that is, something that might appear in a program or specification. Such 
    1409 content would typically be rendered in a C<fixed-width font>, preferably 
     1418content would typically be rendered in a C<fixed-width font> (preferably 
    14101419a different font from that used for the C<T<>> or C<K<>> formatting 
    1411 codes. The contents of a C<C<>> code are L<space-preserved| 
    1412 #Space-preserving text> and L<verbatim| #Verbatim text>. 
     1420codes) or with C< <samp>...</samp> > tags. The contents of a C<C<>> code 
     1421are L<space-preserved| #Space-preserving text> and L<verbatim| #Verbatim text>. 
    14131422The C<C<>> code is the inline equivalent of the C<=code> block. 
    14141423 
     
    14491458=end code 
    14501459 
    1451 Typically replaceables would be rendered in fixed-width italics. The 
    1452 font used should be the same as that used for the C<C<>> code, unless 
    1453 the C<R<>> is inside a C<K<>> or C<T<>> code (or the equivalent 
    1454 C<=input> or C<=output> blocks), in which case their respective fonts 
    1455 should be used. 
     1460Typically replaceables would be rendered in R<fixed-width italics> or with 
     1461C< <var>...</var> > tags. The font used should be the same as that used for 
     1462the C<C<>> code, unless the C<R<>> is inside a C<K<>> or C<T<>> code (or 
     1463the equivalent C<=input> or C<=output> blocks), in which case their 
     1464respective fonts should be used. 
    14561465=end item 
    14571466 
     
    15021511 
    15031512=for code :allow<B> 
    1504     In Perl 5 POD, the B´V<ªZ<>>B´>ª code was widely used to break up text 
     1513    In Perl 5 POD, the B�V<�Z<>B�>� code was widely used to break up text 
    15051514    that would otherwise be considered mark-up. 
    15061515 
     
    15091518 
    15101519=for code :allow<B> 
    1511     In Perl 5 POD, the B´C<ªZ<>B´>ª code was widely used to break up text 
     1520    In Perl 5 POD, the B�C<�Z<>B�>� code was widely used to break up text 
    15121521    that would otherwise be considered mark-up. 
    15131522 
     
    15741583 
    15751584=for code :allow<B> 
    1576     Please forward bug reports to L<B<mailto:devnull@megagigatera.com>> 
     1585    Please forward bug reports to L<B<mailto:devnull@rt.cpan.org>> 
    15771586 
    15781587=end item 
     
    15971606    view the results. See also: L<B<doc:perldata>>. 
    15981607 
     1608=end item 
     1609 
     1610=begin item :term<C<defn:>> 
     1611 
     1612A link to the L<definition|#Definitions> of the specified term within 
     1613the current document. For example: 
     1614 
     1615=for code :allow<B> 
     1616    He was highly prone to D<lexiphania>: an unfortunate proclivity for 
     1617    employing sesquipedalian words (such as "proclivity", 
     1618    "sesquipedalian", and indeed "lexiphania"). 
     1619     
     1620and later, to link back to the definition 
     1621 
     1622   To treat his chronic L<defn:lexiphania> the doctor prescribed an 
     1623   immediate glossectomy or, if that proved ineffective, a complete 
     1624   cephalectomy. 
     1625     
    15991626=end item 
    16001627 
     
    16451672=head3 Placement links 
    16461673 
    1647 A second kind of link--the C<P<>> or B<placement link>--works in the 
     1674A second kind of linkE<mdash>the C<P<>> or B<placement link>E<mdash>works in the 
    16481675opposite direction. Instead of directing focus out to another document, 
    16491676it allows you to draw the contents of another document into your own. 
     
    16611688 
    16621689    =DISCLAIMER 
    1663     P<http://www.megagigatera.com/std/disclaimer.txt> 
     1690    P<http://www.MegaGigaTeraPetaCorp.com/std/disclaimer.txt> 
    16641691 
    16651692might produce: 
     
    16681695B<Copyright> 
    16691696 
    1670 This document is copyright (c) MegaGigaTeraCorp, 2006. All rights reserved. 
     1697This document is copyright (c) MegaGigaTeraPetaCorp, 2006. All rights reserved. 
    16711698 
    16721699B<Disclaimer> 
     
    16921719B<Disclaimer> 
    16931720 
    1694 See: L<http://www.megagigatera.com/std/disclaimer.txt> 
     1721See: L<http://www.MegaGigaTeraPetaCorp.com/std/disclaimer.txt> 
    16951722=end nested 
    16961723 
     
    16991726 
    17001727Any text enclosed in an C<S<>> code is formatted normally, except that 
    1701 every whitespace character in it--including any newline--is preserved. 
     1728every whitespace character in itE<mdash>including any newlineE<mdash>is preserved. 
    17021729These characters are also treated as being non-breaking (except for the 
    17031730newlines, of course). For example: