Install Perl 5.8.8
[msysgit.git] / mingw / html / lib / CGI / Pretty.html
blobcbe84c78933e69233a7f04007cb1e74c283f7b5f
1 <?xml version="1.0" ?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <title>CGI::Pretty - module to produce nicely formatted HTML code</title>
6 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7 <link rev="made" href="mailto:" />
8 </head>
10 <body style="background-color: white">
11 <table border="0" width="100%" cellspacing="0" cellpadding="3">
12 <tr><td class="block" style="background-color: #cccccc" valign="middle">
13 <big><strong><span class="block">&nbsp;CGI::Pretty - module to produce nicely formatted HTML code</span></strong></big>
14 </td></tr>
15 </table>
17 <p><a name="__index__"></a></p>
18 <!-- INDEX BEGIN -->
20 <ul>
22 <li><a href="#name">NAME</a></li>
23 <li><a href="#synopsis">SYNOPSIS</a></li>
24 <li><a href="#description">DESCRIPTION</a></li>
25 <ul>
27 <li><a href="#tags_that_won_t_be_formatted">Tags that won't be formatted</a></li>
28 <li><a href="#customizing_the_indenting">Customizing the Indenting</a></li>
29 </ul>
31 <li><a href="#bugs">BUGS</a></li>
32 <li><a href="#author">AUTHOR</a></li>
33 <li><a href="#see_also">SEE ALSO</a></li>
34 </ul>
35 <!-- INDEX END -->
37 <hr />
38 <p>
39 </p>
40 <h1><a name="name">NAME</a></h1>
41 <p>CGI::Pretty - module to produce nicely formatted HTML code</p>
42 <p>
43 </p>
44 <hr />
45 <h1><a name="synopsis">SYNOPSIS</a></h1>
46 <pre>
47 use CGI::Pretty qw( :html3 );</pre>
48 <pre>
49 # Print a table with a single data element
50 print table( TR( td( &quot;foo&quot; ) ) );</pre>
51 <p>
52 </p>
53 <hr />
54 <h1><a name="description">DESCRIPTION</a></h1>
55 <p>CGI::Pretty is a module that derives from CGI. It's sole function is to
56 allow users of CGI to output nicely formatted HTML code.</p>
57 <p>When using the CGI module, the following code:
58 print table( TR( td( ``foo'' ) ) );</p>
59 <p>produces the following output:
60 &lt;TABLE&gt;&lt;TR&gt;&lt;TD&gt;foo&lt;/TD&gt;&lt;/TR&gt;&lt;/TABLE&gt;</p>
61 <p>If a user were to create a table consisting of many rows and many columns,
62 the resultant HTML code would be quite difficult to read since it has no
63 carriage returns or indentation.</p>
64 <p>CGI::Pretty fixes this problem. What it does is add a carriage
65 return and indentation to the HTML code so that one can easily read
66 it.</p>
67 <pre>
68 print table( TR( td( &quot;foo&quot; ) ) );</pre>
69 <p>now produces the following output:
70 &lt;TABLE&gt;
71 &lt;TR&gt;
72 &lt;TD&gt;
73 foo
74 &lt;/TD&gt;
75 &lt;/TR&gt;
76 &lt;/TABLE&gt;</p>
77 <p>
78 </p>
79 <h2><a name="tags_that_won_t_be_formatted">Tags that won't be formatted</a></h2>
80 <p>The &lt;A&gt; and &lt;PRE&gt; tags are not formatted. If these tags were formatted, the
81 user would see the extra indentation on the web browser causing the page to
82 look different than what would be expected. If you wish to add more tags to
83 the list of tags that are not to be touched, push them onto the <code>@AS_IS</code> array:</p>
84 <pre>
85 push @CGI::Pretty::AS_IS,qw(CODE XMP);</pre>
86 <p>
87 </p>
88 <h2><a name="customizing_the_indenting">Customizing the Indenting</a></h2>
89 <p>If you wish to have your own personal style of indenting, you can change the
90 <code>$INDENT</code> variable:</p>
91 <pre>
92 $CGI::Pretty::INDENT = &quot;\t\t&quot;;</pre>
93 <p>would cause the indents to be two tabs.</p>
94 <p>Similarly, if you wish to have more space between lines, you may change the
95 <code>$LINEBREAK</code> variable:</p>
96 <pre>
97 $CGI::Pretty::LINEBREAK = &quot;\n\n&quot;;</pre>
98 <p>would create two carriage returns between lines.</p>
99 <p>If you decide you want to use the regular CGI indenting, you can easily do
100 the following:</p>
101 <pre>
102 $CGI::Pretty::INDENT = $CGI::Pretty::LINEBREAK = &quot;&quot;;</pre>
104 </p>
105 <hr />
106 <h1><a name="bugs">BUGS</a></h1>
107 <p>This section intentionally left blank.</p>
109 </p>
110 <hr />
111 <h1><a name="author">AUTHOR</a></h1>
112 <p>Brian Paulsen &lt;<a href="mailto:Brian@ThePaulsens.com">Brian@ThePaulsens.com</a>&gt;, with minor modifications by
113 Lincoln Stein &lt;<a href="mailto:lstein@cshl.org">lstein@cshl.org</a>&gt; for incorporation into the CGI.pm
114 distribution.</p>
115 <p>Copyright 1999, Brian Paulsen. All rights reserved.</p>
116 <p>This library is free software; you can redistribute it and/or modify
117 it under the same terms as Perl itself.</p>
118 <p>Bug reports and comments to <a href="mailto:Brian@ThePaulsens.com.">Brian@ThePaulsens.com.</a> You can also write
119 to <a href="mailto:lstein@cshl.org,">lstein@cshl.org,</a> but this code looks pretty hairy to me and I'm not
120 sure I understand it!</p>
122 </p>
123 <hr />
124 <h1><a name="see_also">SEE ALSO</a></h1>
125 <p><a href="file://C|\msysgit\mingw\html/lib/CGI.html">the CGI manpage</a></p>
126 <table border="0" width="100%" cellspacing="0" cellpadding="3">
127 <tr><td class="block" style="background-color: #cccccc" valign="middle">
128 <big><strong><span class="block">&nbsp;CGI::Pretty - module to produce nicely formatted HTML code</span></strong></big>
129 </td></tr>
130 </table>
132 </body>
134 </html>