checker.html

来自「perl教程」· HTML 代码 · 共 473 行 · 第 1/2 页

HTML
473
字号
<?xml version="1.0" ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<!-- saved from url=(0017)http://localhost/ -->
<script language="JavaScript" src="../../displayToc.js"></script>
<script language="JavaScript" src="../../tocParas.js"></script>
<script language="JavaScript" src="../../tocTab.js"></script>
<link rel="stylesheet" type="text/css" href="../../scineplex.css">
<title>podchecker - check pod documents for syntax errors</title>
<link rel="stylesheet" href="../../Active.css" type="text/css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:" />
</head>

<body>

<script>writelinks('__top__',2);</script>
<h1><a>podchecker - check pod documents for syntax errors</a></h1>
<p><a name="__index__"></a></p>

<!-- INDEX BEGIN -->

<ul>

	<li><a href="#name">NAME</a></li>
	<li><a href="#synopsis">SYNOPSIS</a></li>
	<li><a href="#options_arguments">OPTIONS/ARGUMENTS</a></li>
	<ul>

		<li><a href="#podchecker__"><code>podchecker()</code></a></li>
	</ul>

	<li><a href="#description">DESCRIPTION</a></li>
	<li><a href="#diagnostics">DIAGNOSTICS</a></li>
	<ul>

		<li><a href="#errors">Errors</a></li>
		<li><a href="#warnings">Warnings</a></li>
		<li><a href="#hyperlinks">Hyperlinks</a></li>
	</ul>

	<li><a href="#return_value">RETURN VALUE</a></li>
	<li><a href="#examples">EXAMPLES</a></li>
	<li><a href="#interface">INTERFACE</a></li>
	<li><a href="#author">AUTHOR</a></li>
</ul>
<!-- INDEX END -->

<hr />
<p>
</p>
<h1><a name="name">NAME</a></h1>
<p>Pod::Checker, <code>podchecker()</code> - check pod documents for syntax errors</p>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<pre>
  <span class="keyword">use</span> <span class="variable">Pod::Checker</span><span class="operator">;</span>
</pre>
<pre>
  <span class="variable">$syntax_okay</span> <span class="operator">=</span> <span class="variable">podchecker</span><span class="operator">(</span><span class="variable">$filepath</span><span class="operator">,</span> <span class="variable">$outputpath</span><span class="operator">,</span> <span class="variable">%options</span><span class="operator">);</span>
</pre>
<pre>
  <span class="keyword">my</span> <span class="variable">$checker</span> <span class="operator">=</span> <span class="variable">new</span> <span class="variable">Pod::Checker</span> <span class="variable">%options</span><span class="operator">;</span>
  <span class="variable">$checker</span><span class="operator">-&gt;</span><span class="variable">parse_from_file</span><span class="operator">(</span><span class="variable">$filepath</span><span class="operator">,</span> <span class="operator">\</span><span class="variable">*STDERR</span><span class="operator">);</span>
</pre>
<p>
</p>
<hr />
<h1><a name="options_arguments">OPTIONS/ARGUMENTS</a></h1>
<p><code>$filepath</code> is the input POD to read and <code>$outputpath</code> is
where to write POD syntax error messages. Either argument may be a scalar
indicating a file-path, or else a reference to an open filehandle.
If unspecified, the input-file it defaults to <code>\*STDIN</code>, and
the output-file defaults to <code>\*STDERR</code>.</p>
<p>
</p>
<h2><a name="podchecker__"><code>podchecker()</code></a></h2>
<p>This function can take a hash of options:</p>
<dl>
<dt><strong><a name="item__2dwarnings__3d_3e_val"><strong>-warnings</strong> =&gt; <em>val</em></a></strong>

<dd>
<p>Turn warnings on/off. <em>val</em> is usually 1 for on, but higher values
trigger additional warnings. See <a href="#warnings">Warnings</a>.</p>
</dd>
</li>
</dl>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p><strong>podchecker</strong> will perform syntax checking of Perl5 POD format documentation.</p>
<p>Curious/ambitious users are welcome to propose additional features they wish
to see in <strong>Pod::Checker</strong> and <strong>podchecker</strong> and verify that the checks are
consistent with <a href="../../lib/Pod/perlpod.html">the perlpod manpage</a>.</p>
<p>The following checks are currently performed:</p>
<ul>
<li>
<p>Unknown '=xxxx' commands, unknown 'X&lt;...&gt;' interior-sequences,
and unterminated interior sequences.</p>
</li>
<li>
<p>Check for proper balancing of <code>=begin</code> and <code>=end</code>. The contents of such
a block are generally ignored, i.e. no syntax checks are performed.</p>
</li>
<li>
<p>Check for proper nesting and balancing of <code>=over</code>, <code>=item</code> and <code>=back</code>.</p>
</li>
<li>
<p>Check for same nested interior-sequences (e.g. 
<code>L&lt;...L&lt;...&gt;...&gt;</code>).</p>
</li>
<li>
<p>Check for malformed or nonexisting entities <code>E&lt;...&gt;</code>.</p>
</li>
<li>
<p>Check for correct syntax of hyperlinks <code>L&lt;...&gt;</code>. See <a href="../../lib/Pod/perlpod.html">the perlpod manpage</a>
for details.</p>
</li>
<li>
<p>Check for unresolved document-internal links. This check may also reveal
misspelled links that seem to be internal links but should be links
to something else.</p>
</li>
</ul>
<p>
</p>
<hr />
<h1><a name="diagnostics">DIAGNOSTICS</a></h1>
<p>
</p>
<h2><a name="errors">Errors</a></h2>
<ul>
<li><strong><a name="item_empty__3dheadn">empty =headn</a></strong>

<p>A heading (<code>=head1</code> or <code>=head2</code>) without any text? That ain't no
heading!</p>
</li>
<li><strong><a name="item__3dover_on_line_n_without_closing__3dback">=over on line <em>N</em> without closing =back</a></strong>

<p>The <code>=over</code> command does not have a corresponding <code>=back</code> before the
next heading (<code>=head1</code> or <code>=head2</code>) or the end of the file.</p>
</li>
<li><strong><a name="item__3ditem_without_previous__3dover">=item without previous =over</a></strong>

<li><strong><a name="item__3dback_without_previous__3dover">=back without previous =over</a></strong>

<p>An <code>=item</code> or <code>=back</code> command has been found outside a
<code>=over</code>/<code>=back</code> block.</p>
</li>
<li><strong><a name="item_no_argument_for__3dbegin">No argument for =begin</a></strong>

<p>A <code>=begin</code> command was found that is not followed by the formatter
specification.</p>
</li>
<li><strong><a name="item__3dend_without__3dbegin">=end without =begin</a></strong>

<p>A standalone <code>=end</code> command was found.</p>
</li>
<li><strong><a name="item_nested__3dbegin_27s">Nested =begin's</a></strong>

<p>There were at least two consecutive <code>=begin</code> commands without
the corresponding <code>=end</code>. Only one <code>=begin</code> may be active at
a time.</p>
</li>
<li><strong><a name="item__3dfor_without_formatter_specification">=for without formatter specification</a></strong>

<p>There is no specification of the formatter after the <code>=for</code> command.</p>
</li>
<li><strong><a name="item_unresolved_internal_link_name">unresolved internal link <em>NAME</em></a></strong>

<p>The given link to <em>NAME</em> does not have a matching node in the current
POD. This also happend when a single word node name is not enclosed in
<code>&quot;&quot;</code>.</p>
</li>
<li><strong><a name="item_unknown_command__22cmd_22">Unknown command &quot;<em>CMD</em>&quot;</a></strong>

<p>An invalid POD command has been found. Valid are <code>=head1</code>, <code>=head2</code>,
<code>=head3</code>, <code>=head4</code>, <code>=over</code>, <code>=item</code>, <code>=back</code>, <code>=begin</code>, <code>=end</code>,
<code>=for</code>, <code>=pod</code>, <code>=cut</code></p>
</li>
<li><strong><a name="item_unknown_interior_2dsequence__22seq_22">Unknown interior-sequence &quot;<em>SEQ</em>&quot;</a></strong>

<p>An invalid markup command has been encountered. Valid are:
<code>B&lt;&gt;</code>, <code>C&lt;&gt;</code>, <code>E&lt;&gt;</code>, <code>F&lt;&gt;</code>, 
<code>I&lt;&gt;</code>, <code>L&lt;&gt;</code>, <code>S&lt;&gt;</code>, <code>X&lt;&gt;</code>, 
<code>Z&lt;&gt;</code></p>
</li>
<li><strong><a name="item_nested_commands_cmd_3c_2e_2e_2ecmd_3c_2e_2e_2e_3e_">nested commands <em>CMD</em>&lt;...<em>CMD</em>&lt;...&gt;...&gt;</a></strong>

<p>Two nested identical markup commands have been found. Generally this
does not make sense.</p>
</li>
<li><strong><a name="item_garbled_entity_string">garbled entity <em>STRING</em></a></strong>

<p>The <em>STRING</em> found cannot be interpreted as a character entity.</p>
</li>
<li><strong><a name="item_entity_number_out_of_range">Entity number out of range</a></strong>

<p>An entity specified by number (dec, hex, oct) is out of range (1-255).</p>
</li>
<li><strong><a name="item_malformed_link_l_3c_3e">malformed link L&lt;&gt;</a></strong>

<p>The link found cannot be parsed because it does not conform to the
syntax described in <a href="../../lib/Pod/perlpod.html">the perlpod manpage</a>.</p>
</li>
<li><strong><a name="item_nonempty_z_3c_3e">nonempty Z&lt;&gt;</a></strong>

<p>The <code>Z&lt;&gt;</code> sequence is supposed to be empty.</p>
</li>
<li><strong><a name="item_empty_x_3c_3e">empty X&lt;&gt;</a></strong>

<p>The index entry specified contains nothing but whitespace.</p>
</li>
<li><strong><a name="item_spurious_text_after__3dpod__2f__3dcut">Spurious text after =pod / =cut</a></strong>

<p>The commands <code>=pod</code> and <code>=cut</code> do not take any arguments.</p>
</li>
<li><strong><a name="item_character">Spurious <code>character(s)</code> after =back</a></strong>

<p>The <code>=back</code> command does not take any arguments.</p>
</li>
</ul>
<p>
</p>
<h2><a name="warnings">Warnings</a></h2>
<p>These may not necessarily cause trouble, but indicate mediocre style.</p>
<ul>
<li><strong><a name="item_multiple_occurrence_of_link_target_name">multiple occurrence of link target <em>name</em></a></strong>

<p>The POD file has some <code>=item</code> and/or <code>=head</code> commands that have
the same text. Potential hyperlinks to such a text cannot be unique then.
This warning is printed only with warning level greater than one.</p>
</li>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?