Difference between revisions of "API:EPrints/Test/Pod2Wiki"

From EPrints Documentation
Jump to: navigation, search
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
<!-- Pod2Wiki=_preamble_  
 
<!-- Pod2Wiki=_preamble_  
This page has been automatically generated from the EPrints 3.2 source. Any wiki changes made between the 'Pod2Wiki=*' and 'Edit below this comment' comments will be lost.
+
This page has been automatically generated from the EPrints 3.4 source. Any wiki changes made between the 'Pod2Wiki=*' and 'Edit below this comment' comments will be lost.
  -->{{API}}{{Pod2Wiki}}{{API:Source|file=perl_lib/EPrints/Test/Pod2Wiki.pm|package_name=EPrints::Test::Pod2Wiki}}[[Category:API|POD2WIKI]][[Category:API:EPrints/Test|POD2WIKI]][[Category:API:EPrints/Test/Pod2Wiki|POD2WIKI]]<div><!-- Edit below this comment -->
+
  -->{{API}}{{Pod2Wiki}}{{API:Source|file=EPrints/Test/Pod2Wiki.pm|package_name=EPrints::Test::Pod2Wiki}}[[Category:API|POD2WIKI]][[Category:API:EPrints/Test|POD2WIKI]]<div><!-- Edit below this comment -->
  
  
Line 8: Line 8:
 
EPrints::Test::Pod2Wiki - convert EPrints pod to MediaWiki
 
EPrints::Test::Pod2Wiki - convert EPrints pod to MediaWiki
  
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
 +
</div>
 
<!-- Pod2Wiki=head_editing_pod2wiki_pages -->
 
<!-- Pod2Wiki=head_editing_pod2wiki_pages -->
 
==Editing Pod2Wiki Pages==
 
==Editing Pod2Wiki Pages==
 
Pages generated by this module have Pod2Wiki markers inserted. These markers are HTML comments that start and end every {{API:PodLink|file=perlpod|package_name=perlpod|section=|text=Plain Old Documentation}} (POD) section. For example a POD synopsis section will look like this:
 
Pages generated by this module have Pod2Wiki markers inserted. These markers are HTML comments that start and end every {{API:PodLink|file=perlpod|package_name=perlpod|section=|text=Plain Old Documentation}} (POD) section. For example a POD synopsis section will look like this:
  
<pre>  &lt;!-- Pod2Wiki=head_synopsis --&gt;
+
  &lt;!-- Pod2Wiki=head_synopsis --&gt;
 
   ==SYNOPSIS==
 
   ==SYNOPSIS==
 
   use EPrints::Test::Pod2Wiki;
 
   use EPrints::Test::Pod2Wiki;
 
   my $p = EPrints::Test::Pod2Wiki-&amp;gt;new(
 
   my $p = EPrints::Test::Pod2Wiki-&amp;gt;new(
     wiki_index =&amp;gt; "http://wiki.foo.org/index.php",
+
     wiki_api =&amp;gt; "http://wiki.foo.org/api.php",
 
     username =&amp;gt; "johnd",
 
     username =&amp;gt; "johnd",
 
     password =&amp;gt; "xiPi00",
 
     password =&amp;gt; "xiPi00",
Line 26: Line 29:
 
   $p-&amp;gt;update_page( "EPrints::Utils" );
 
   $p-&amp;gt;update_page( "EPrints::Utils" );
 
   &lt;!-- Edit below this comment --&gt;
 
   &lt;!-- Edit below this comment --&gt;
   &lt;!-- Pod2Wiki= --&gt;</pre>
+
   &lt;!-- Pod2Wiki= --&gt;
 
+
 
 
When the Wiki page is updated each Pod2Wiki section is replaced with the equivalent section content from the POD.
 
When the Wiki page is updated each Pod2Wiki section is replaced with the equivalent section content from the POD.
  
 
Comments can be made by adding them to the comment sections:
 
Comments can be made by adding them to the comment sections:
  
<pre>  ...
+
  ...
 
   &lt;!-- Pod2Wiki=head_methods --&gt;
 
   &lt;!-- Pod2Wiki=head_methods --&gt;
 
   ==METHODS==
 
   ==METHODS==
Line 39: Line 42:
 
   This Wiki comment will be kept.
 
   This Wiki comment will be kept.
 
   &lt;!-- Pod2Wiki= --&gt;
 
   &lt;!-- Pod2Wiki= --&gt;
   ...</pre>
+
   ...
 
+
 
 
Note: if a POD section is removed any Wiki content associated with that section will also be removed.
 
Note: if a POD section is removed any Wiki content associated with that section will also be removed.
  
 
The rest of this page concerns the <em>EPrints::Test::Pod2Wiki</em> module.
 
The rest of this page concerns the <em>EPrints::Test::Pod2Wiki</em> module.
  
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
 +
</div>
 
<!-- Pod2Wiki=head_synopsis -->
 
<!-- Pod2Wiki=head_synopsis -->
 
==SYNOPSIS==
 
==SYNOPSIS==
<source lang="perl">use EPrints::Test::Pod2Wiki;
+
  use EPrints::Test::Pod2Wiki;
 
+
 
my $p = EPrints::Test::Pod2Wiki->new(
+
  my $p = EPrints::Test::Pod2Wiki-&gt;new(
wiki_index => "http://wiki.foo.org/index.php",
+
    wiki_api =&gt; "http://wiki.foo.org/api.php",
username => "johnd",
+
    username =&gt; "johnd",
password => "xiPi00",
+
    password =&gt; "xiPi00",
);
+
    );
 
+
 
$p->update_page( "EPrints::Utils" );</source>
+
  $p-&gt;update_page( "EPrints::Utils" );
 
+
 
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
 +
</div>
 
<!-- Pod2Wiki=head_description -->
 
<!-- Pod2Wiki=head_description -->
 
==DESCRIPTION==
 
==DESCRIPTION==
 
This module enables the integration of EPrints POD (documentation) and MediaWiki pages.
 
This module enables the integration of EPrints POD (documentation) and MediaWiki pages.
  
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
 +
</div>
 
<!-- Pod2Wiki=head_methods -->
 
<!-- Pod2Wiki=head_methods -->
 
==METHODS==
 
==METHODS==
<!-- Pod2Wiki=head_new -->
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 +
<!-- Edit below this comment -->
 +
 
 +
 
 +
<!-- Pod2Wiki= -->
 +
</div>
 +
<!-- Pod2Wiki=item_new -->
 
===new===
 
===new===
  
<source lang="perl">EPrints::Test::Pod2Wiki->new( ... )
+
EPrints::Test::Pod2Wiki-&gt;new( $class, %opts )
 
 
</source>
 
 
Create a new Pod2Wiki parser. Required options:
 
Create a new Pod2Wiki parser. Required options:
  
<pre>  wiki_index - URL of the MediaWiki "index.php" page
+
  wiki_api - URL of the MediaWiki "api.php" page
 
   username - MediaWiki username
 
   username - MediaWiki username
 
   password - MediaWiki password
 
   password - MediaWiki password
   comments - "section", "none"</pre>
+
    
 
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=head_update_page -->
+
</div>
 +
<!-- Pod2Wiki=item_update_page -->
 
===update_page===
 
===update_page===
  
<source lang="perl">$ok = $pod->update_page( $package_name )
+
$ok = $pod-&gt;update_page( $package_name, $selfcat )
 
+
Update the MediaWiki page for $package_name.  If $selfcat then add to its own category.
</source>
 
Update the MediaWiki page for $package_name.
 
  
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=head_command -->
+
</div>
 +
<!-- Pod2Wiki=item_command -->
 
===command===
 
===command===
  
<source lang="perl">$parser->command( ... )
+
$parser-&gt;command( $cmd, $text, $line_num, $pod_para )
 
 
</source>
 
 
{{API:PodLink|file=Pod/Parser|package_name=Pod::Parser|section=|text=Pod::Parser}} callback.
 
{{API:PodLink|file=Pod/Parser|package_name=Pod::Parser|section=|text=Pod::Parser}} callback.
  
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=head_verbatim -->
+
</div>
 +
<!-- Pod2Wiki=item_verbatim -->
 
===verbatim===
 
===verbatim===
  
<source lang="perl">$parser->verbatim( ... )
+
$parser-&gt;verbatim( $text, $line_num, $pod_para )
 
 
</source>
 
 
{{API:PodLink|file=Pod/Parser|package_name=Pod::Parser|section=|text=Pod::Parser}} callback.
 
{{API:PodLink|file=Pod/Parser|package_name=Pod::Parser|section=|text=Pod::Parser}} callback.
  
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=head_textblock -->
+
</div>
 +
<!-- Pod2Wiki=item_textblock -->
 
===textblock===
 
===textblock===
  
<source lang="perl">$parser->textblock( ... )
+
$parser-&gt;textblock( $text, $line_num, $pod_para )
 
 
</source>
 
 
{{API:PodLink|file=Pod/Parser|package_name=Pod::Parser|section=|text=Pod::Parser}} callback.
 
{{API:PodLink|file=Pod/Parser|package_name=Pod::Parser|section=|text=Pod::Parser}} callback.
  
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=head_interpolate -->
+
</div>
 +
<!-- Pod2Wiki=item_interpolate -->
 
===interpolate===
 
===interpolate===
  
<source lang="perl">$parser->interpolate( ... )
+
$parser-&gt;interpolate( $text, $line_num )
 
 
</source>
 
 
{{API:PodLink|file=Pod/Parser|package_name=Pod::Parser|section=|text=Pod::Parser}} callback. Overloaded to also escape HTML entities.
 
{{API:PodLink|file=Pod/Parser|package_name=Pod::Parser|section=|text=Pod::Parser}} callback. Overloaded to also escape HTML entities.
  
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=head_interior_sequence -->
+
</div>
 +
<!-- Pod2Wiki=item_interior_sequence -->
 
===interior_sequence===
 
===interior_sequence===
  
<source lang="perl">$parser->interior_sequence( ... )
+
$parser-&gt;interior_sequence( $seq_cmd, $seq_arg, $pod_seq )
 
 
</source>
 
 
{{API:PodLink|file=Pod/Parser|package_name=Pod::Parser|section=|text=Pod::Parser}} callback.
 
{{API:PodLink|file=Pod/Parser|package_name=Pod::Parser|section=|text=Pod::Parser}} callback.
  
 +
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
 +
<span style='display:none'>User Comments</span>
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
 +
</div>
 
<!-- Pod2Wiki=head_copyright -->
 
<!-- Pod2Wiki=head_copyright -->
 
==COPYRIGHT==
 
==COPYRIGHT==
Copyright 2000-2011 University of Southampton.
+
{{API:Copyright}}
 
+
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #ccepadding: 0em 1em 0em 1em; font-size: 80%; '>
This file is part of EPrints http://www.eprints.org/.
+
<span style='display:none'>User Comments</span>
 
 
EPrints is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
 
 
 
EPrints is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
 
 
 
You should have received a copy of the GNU Lesser General Public License along with EPrints.  If not, see http://www.gnu.org/licenses/.
 
 
 
 
<!-- Edit below this comment -->
 
<!-- Edit below this comment -->
  
  
 
<!-- Pod2Wiki= -->
 
<!-- Pod2Wiki= -->
<!-- Pod2Wiki=_postamble_ -->
+
</div>
<!-- Edit below this comment -->
+
<!-- Pod2Wiki=_postamble_ --><!-- Edit below this comment -->

Latest revision as of 08:46, 15 December 2021

EPrints 3 Reference: Directory Structure - Metadata Fields - Repository Configuration - XML Config Files - XML Export Format - EPrints data structure - Core API - Data Objects


API: Core API

Latest Source Code (3.4, 3.3) | Revision Log | Before editing this page please read Pod2Wiki


NAME

EPrints::Test::Pod2Wiki - convert EPrints pod to MediaWiki

User Comments


Editing Pod2Wiki Pages

Pages generated by this module have Pod2Wiki markers inserted. These markers are HTML comments that start and end every Plain Old Documentation (POD) section. For example a POD synopsis section will look like this:

 <!-- Pod2Wiki=head_synopsis -->
 ==SYNOPSIS==
 use EPrints::Test::Pod2Wiki;
 my $p = EPrints::Test::Pod2Wiki-&gt;new(
   wiki_api =&gt; "http://wiki.foo.org/api.php",
   username =&gt; "johnd",
   password =&gt; "xiPi00",
 );
 $p-&gt;update_page( "EPrints::Utils" );
 <!-- Edit below this comment -->
 <!-- Pod2Wiki= -->
 

When the Wiki page is updated each Pod2Wiki section is replaced with the equivalent section content from the POD.

Comments can be made by adding them to the comment sections:

 ...
 <!-- Pod2Wiki=head_methods -->
 ==METHODS==
 Any changes here will be lost
 <!-- Edit below this comment -->
 This Wiki comment will be kept.
 <!-- Pod2Wiki= -->
 ...
 

Note: if a POD section is removed any Wiki content associated with that section will also be removed.

The rest of this page concerns the EPrints::Test::Pod2Wiki module.

User Comments


SYNOPSIS

 use EPrints::Test::Pod2Wiki;
 
 my $p = EPrints::Test::Pod2Wiki->new(
   wiki_api => "http://wiki.foo.org/api.php",
   username => "johnd",
   password => "xiPi00",
   );
 
 $p->update_page( "EPrints::Utils" );
 

User Comments


DESCRIPTION

This module enables the integration of EPrints POD (documentation) and MediaWiki pages.

User Comments


METHODS

User Comments


new

EPrints::Test::Pod2Wiki->new( $class, %opts )

Create a new Pod2Wiki parser. Required options:

 wiki_api - URL of the MediaWiki "api.php" page
 username - MediaWiki username
 password - MediaWiki password
 

User Comments


update_page

$ok = $pod->update_page( $package_name, $selfcat )

Update the MediaWiki page for $package_name. If $selfcat then add to its own category.

User Comments


command

$parser->command( $cmd, $text, $line_num, $pod_para )

Pod::Parser callback.

User Comments


verbatim

$parser->verbatim( $text, $line_num, $pod_para )

Pod::Parser callback.

User Comments


textblock

$parser->textblock( $text, $line_num, $pod_para )

Pod::Parser callback.

User Comments


interpolate

$parser->interpolate( $text, $line_num )

Pod::Parser callback. Overloaded to also escape HTML entities.

User Comments


interior_sequence

$parser->interior_sequence( $seq_cmd, $seq_arg, $pod_seq )

Pod::Parser callback.

User Comments


COPYRIGHT

© Copyright 2023 University of Southampton.

EPrints 3.4 is supplied by EPrints Services.

http://www.eprints.org/eprints-3.4/

LICENSE

This file is part of EPrints 3.4 http://www.eprints.org/.

EPrints 3.4 and this file are released under the terms of the GNU Lesser General Public License version 3 as published by the Free Software Foundation unless otherwise stated.

EPrints 3.4 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with EPrints 3.4. If not, see http://www.gnu.org/licenses/.

User Comments