• This web contains the official documentation of the
TWiki Release 4.1, code named
EdinburghRelease. It is a read-only web for reference.
• This is an older release, see
TWiki-6.1 for the latest release documentation.
Perl Doc Plugin
This Plugin extracts the Perl documentation (POD) from a Perl module located in the
@INC library path and displays it in a topic.
Syntax Rules and Example
Write
%PERLDOC{"Module"}%
to display the documentation of a Perl module, for example
%PERLDOC{"File::Copy"}%
shows the doc of
File::Copy
. Optionally use a
format="pod"
parameter to see the raw POD format, or
format="twiki"
to see the TWiki markup text.
Use the following form to see the documentation of a Perl module: (this Plugin needs to be installed and enabled)
PerlDocPlugin: Nothing to do, no module specified.
Perl code with POD (Plain Old Documentation)
Perl code may contain blocks of documentation. A block typically starts with a
=pod
or
=head1
at the beginning of a line, and ends with
=cut
at the beginning of a line or at the end of the file. Read the details in
http://www.perldoc.com/perl5.6/pod/perlpod.html
POD example:
=head1 Demo of POD
Silly paragraph
=cut
Perl code with TWiki markup
TWiki markup can be used inside a
=begin twiki
...
=end twiki
block. Keep in mind that this markup gets parsed correctly only by the PerlDocPlugin, other POD translator ignore the block. The TWiki markup is richer and more compact then POD. Example:
=begin twiki
---++ Demo of TWiki markup
Silly paragraph
=end twiki
=cut
PerlDocPlugin Global Settings
Plugin settings are stored as preferences variables. To reference a plugin setting write
%<plugin>_<setting>%
, i.e.
%PODTOTWIKIPLUGIN_SHORTDESCRIPTION%
- One line description, is shown in the TextFormattingRules topic:
- Set SHORTDESCRIPTION = Extract the Perl documentation (POD) from a Perl module and display it in a topic.
- Debug Plugin: (See output in
data/debug.txt
)
Limitations
- Links (
L<....>
) are not supported
Plugin Installation Instructions
Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the server where TWiki is running.
- Download the ZIP file from the Plugin web (see below)
- Unzip
PerlDocPlugin.zip
in your twiki installation directory. Content: File: | Description: |
data/TWiki/PerlDocPlugin.txt | Plugin topic |
data/TWiki/PerlDocPlugin.txt,v | Plugin topic repository |
lib/TWiki/Plugins/PerlDocPlugin.pm | Plugin Perl module |
- Test above example if the installation was successful. You should see a "Nothing to do, no module specified" message below the form if the Plugin is enabled.
Plugin Info
Related Topics: TWikiPreferences,
TWikiPlugins
--
TWiki:Main/PeterThoeny - 07 Dec 2002