parseutils.html

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

HTML
388
字号
<dt><strong><a name="item_markup">$link-&gt;<code>markup($string)</code></a></strong>

<dd>
<p>Set/retrieve the textual value of the link. This string contains special
markers <code>P&lt;&gt;</code> and <code>Q&lt;&gt;</code> that should be expanded by the
translator's interior sequence expansion engine to the
formatter-specific code to highlight/activate the hyperlink. The details
have to be implemented in the translator.</p>
</dd>
</li>
<dt><strong><a name="item_text">$link-&gt;<code>text()</code></a></strong>

<dd>
<p>This method returns the textual representation of the hyperlink as above,
but without markers (read only). Depending on the link type this is one of
the following alternatives (the + and * denote the portions of the text
that are marked up):</p>
</dd>
<dd>
<pre>
  +perl+                    L&lt;perl&gt;
  *$|* in +<a href="../../lib/Pod/perlvar.html">perlvar</a>+         L&lt;<a href="../../lib/Pod/perlvar.html">perlvar</a>/$|&gt;
  *OPTIONS* in +<a href="../../lib/Pod/perldoc.html">perldoc</a>+    L&lt;<a href="../../lib/Pod/perldoc.html">perldoc</a>/&quot;OPTIONS&quot;&gt;
  *DESCRIPTION*             L&lt;&quot;DESCRIPTION&quot;&gt;</pre>
</dd>
</li>
<dt><strong><a name="item_warning">$link-&gt;<code>warning()</code></a></strong>

<dd>
<p>After parsing, this method returns any warnings encountered during the
parsing process.</p>
</dd>
</li>
<dt><strong>$link-&gt;<code>file()</code></strong>

<dt><strong><a name="item_line">$link-&gt;<code>line()</code></a></strong>

<dd>
<p>Just simple slots for storing information about the line and the file
the link was encountered in. Has to be filled in manually.</p>
</dd>
</li>
<dt><strong><a name="item_page">$link-&gt;<code>page()</code></a></strong>

<dd>
<p>This method sets or returns the POD page this link points to.</p>
</dd>
</li>
<dt><strong><a name="item_node">$link-&gt;<code>node()</code></a></strong>

<dd>
<p>As above, but the destination node text of the link.</p>
</dd>
</li>
<dt><strong><a name="item_alttext">$link-&gt;<code>alttext()</code></a></strong>

<dd>
<p>Sets or returns an alternative text specified in the link.</p>
</dd>
</li>
<dt><strong>$link-&gt;<code>type()</code></strong>

<dd>
<p>The node type, either <code>section</code> or <a href="#item_item"><code>item</code></a>. As an unofficial type,
there is also <code>hyperlink</code>, derived from e.g. <code>L&lt;http://perl.com&gt;</code></p>
</dd>
</li>
<dt><strong><a name="item_link">$link-&gt;<code>link()</code></a></strong>

<dd>
<p>Returns the link as contents of <code>L&lt;&gt;</code>. Reciprocal to <strong>parse()</strong>.</p>
</dd>
</li>
</dl>
<p>
</p>
<h2><a name="pod__cache">Pod::Cache</a></h2>
<p><strong>Pod::Cache</strong> holds information about a set of POD documents,
especially the nodes for hyperlinks.
The following methods are available:</p>
<dl>
<dt><strong>Pod::Cache-&gt;<code>new()</code></strong>

<dd>
<p>Create a new cache object. This object can hold an arbitrary number of
POD documents of class Pod::Cache::Item.</p>
</dd>
</li>
<dt><strong>$cache-&gt;<code>item()</code></strong>

<dd>
<p>Add a new item to the cache. Without arguments, this method returns a
list of all cache elements.</p>
</dd>
</li>
<dt><strong><a name="item_find_page">$cache-&gt;<code>find_page($name)</code></a></strong>

<dd>
<p>Look for a POD document named <code>$name</code> in the cache. Returns the
reference to the corresponding Pod::Cache::Item object or undef if
not found.</p>
</dd>
</li>
</dl>
<p>
</p>
<h2><a name="pod__cache__item">Pod::Cache::Item</a></h2>
<p><strong>Pod::Cache::Item</strong> holds information about individual POD documents,
that can be grouped in a Pod::Cache object.
It is intended to hold information about the hyperlink nodes of POD
documents.
The following methods are available:</p>
<dl>
<dt><strong>Pod::Cache::Item-&gt;<code>new()</code></strong>

<dd>
<p>Create a new object.</p>
</dd>
</li>
<dt><strong>$cacheitem-&gt;<code>page()</code></strong>

<dd>
<p>Set/retrieve the POD document name (e.g. &quot;Pod::Parser&quot;).</p>
</dd>
</li>
<dt><strong><a name="item_description">$cacheitem-&gt;<code>description()</code></a></strong>

<dd>
<p>Set/retrieve the POD short description as found in the <code>=head1 NAME</code>
section.</p>
</dd>
</li>
<dt><strong><a name="item_path">$cacheitem-&gt;<code>path()</code></a></strong>

<dd>
<p>Set/retrieve the POD file storage path.</p>
</dd>
</li>
<dt><strong>$cacheitem-&gt;<code>file()</code></strong>

<dd>
<p>Set/retrieve the POD file name.</p>
</dd>
</li>
<dt><strong><a name="item_nodes">$cacheitem-&gt;<code>nodes()</code></a></strong>

<dd>
<p>Add a node (or a list of nodes) to the document's node list. Note that
the order is kept, i.e. start with the first node and end with the last.
If no argument is given, the current list of nodes is returned in the
same order the nodes have been added.
A node can be any scalar, but usually is a pair of node string and
unique id for the <a href="#item_find_node"><code>find_node</code></a> method to work correctly.</p>
</dd>
</li>
<dt><strong><a name="item_find_node">$cacheitem-&gt;<code>find_node($name)</code></a></strong>

<dd>
<p>Look for a node or index entry named <code>$name</code> in the object.
Returns the unique id of the node (i.e. the second element of the array
stored in the node arry) or undef if not found.</p>
</dd>
</li>
<dt><strong><a name="item_idx">$cacheitem-&gt;<code>idx()</code></a></strong>

<dd>
<p>Add an index entry (or a list of them) to the document's index list. Note that
the order is kept, i.e. start with the first node and end with the last.
If no argument is given, the current list of index entries is returned in the
same order the entries have been added.
An index entry can be any scalar, but usually is a pair of string and
unique id.</p>
</dd>
</li>
</dl>
<p>
</p>
<hr />
<h1><a name="author">AUTHOR</a></h1>
<p>Please report bugs using <a href="http://rt.cpan.org">http://rt.cpan.org</a>.</p>
<p>Marek Rouchal &lt;<a href="mailto:marekr@cpan.org">marekr@cpan.org</a>&gt;, borrowing
a lot of things from <em>pod2man</em> and <em>pod2roff</em> as well as other POD
processing tools by Tom Christiansen, Brad Appleton and Russ Allbery.</p>
<p>
</p>
<hr />
<h1><a name="see_also">SEE ALSO</a></h1>
<p><em>pod2man</em>, <em>pod2roff</em>, <a href="../../lib/Pod/Parser.html">the Pod::Parser manpage</a>, <a href="../../lib/Pod/Checker.html">the Pod::Checker manpage</a>,
<em>pod2html</em></p>

</body>

</html>

⌨️ 快捷键说明

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