Tags:
create new tag
, view all tags

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)

Perl module name: in format

%PERLDOC{"" format=""}%

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.

  • Enable Plugin: (0 or 1)
    • Set ENABLE = 1

  • Debug Plugin: (See output in data/debug.txt)
    • Set DEBUG = 0

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

Plugin Author: TWiki:Main/PeterThoeny
Plugin Version: 07 Dec 2002 (V1.001)
Change History:  
07 Dec 2002: Removed "=pod" from showing up in html or twiki blocks
01 Dec 2002: Initial version
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.005
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/PerlDocPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/PerlDocPluginDev

Related Topics: TWikiPreferences, TWikiPlugins

-- TWiki:Main/PeterThoeny - 07 Dec 2002

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2002-12-07 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.