Jump to content

API:EPrints/Test/Pod2Wiki: Difference between revisions

From EPrints Documentation
No edit summary
Pod2wiki (talk | contribs)
No edit summary
 
(13 intermediate revisions by 2 users 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=EPrints/Test/Pod2Wiki.pm|package_name=EPrints::Test::Pod2Wiki}}[[Category:API|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 12: Line 12:
<!-- Edit below this comment -->
<!-- Edit below this comment -->


<!-- Pod2Wiki= -->
</div>
<!-- Pod2Wiki= -->
</div>


<!-- Pod2Wiki= -->
<!-- Pod2Wiki= -->
Line 29: Line 23:
   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 58: Line 52:
<!-- Edit below this comment -->
<!-- Edit below this comment -->


<!-- Pod2Wiki= -->
</div>
<!-- Pod2Wiki= -->
</div>


<!-- Pod2Wiki= -->
<!-- Pod2Wiki= -->
Line 72: Line 60:
    
    
   my $p = EPrints::Test::Pod2Wiki-&gt;new(
   my $p = EPrints::Test::Pod2Wiki-&gt;new(
     wiki_index =&gt; "http://wiki.foo.org/index.php",
     wiki_api =&gt; "http://wiki.foo.org/api.php",
     username =&gt; "johnd",
     username =&gt; "johnd",
     password =&gt; "xiPi00",
     password =&gt; "xiPi00",
Line 83: Line 71:
<!-- Edit below this comment -->
<!-- Edit below this comment -->


<!-- Pod2Wiki= -->
</div>
<!-- Pod2Wiki= -->
</div>


<!-- Pod2Wiki= -->
<!-- Pod2Wiki= -->
Line 100: Line 82:
<!-- Edit below this comment -->
<!-- Edit below this comment -->


<!-- Pod2Wiki= -->
</div>
<!-- Pod2Wiki= -->
</div>


<!-- Pod2Wiki= -->
<!-- Pod2Wiki= -->
Line 115: Line 91:
<!-- Edit below this comment -->
<!-- Edit below this comment -->


<!-- Pod2Wiki= -->
</div>
<!-- Pod2Wiki= -->
</div>


<!-- Pod2Wiki= -->
<!-- Pod2Wiki= -->
</div>
</div>
<!-- Pod2Wiki=item_new -->
<!-- Pod2Wiki=item_new -->
===EPrints::Test::Pod2Wiki-&gt;new( ... )===
===new===


EPrints::Test::Pod2Wiki-&gt;new( $class, %opts )
Create a new Pod2Wiki parser. Required options:
Create a new Pod2Wiki parser. Required options:


   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
Line 137: Line 108:
<!-- Edit below this comment -->
<!-- Edit below this comment -->


<!-- Pod2Wiki= -->
</div>
<!-- Pod2Wiki= -->
</div>


<!-- Pod2Wiki= -->
<!-- Pod2Wiki= -->
</div>
</div>
<!-- Pod2Wiki=item_update_page -->
<!-- Pod2Wiki=item_update_page -->
===$ok = $pod-&gt;update_page( $package_name )===
===update_page===


Update the MediaWiki page for $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.


<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
<div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce;  padding: 0em 1em 0em 1em; font-size: 80%; '>
Line 155: Line 121:
<!-- Edit below this comment -->
<!-- Edit below this comment -->


<!-- Pod2Wiki= -->
</div>
<!-- Pod2Wiki= -->
</div>


<!-- Pod2Wiki= -->
<!-- Pod2Wiki= -->
</div>
</div>
<!-- Pod2Wiki=item_command -->
<!-- Pod2Wiki=item_command -->
===$parser-&gt;command( ... )===
===command===


$parser-&gt;command( $cmd, $text, $line_num, $pod_para )
{{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.


Line 173: Line 134:
<!-- Edit below this comment -->
<!-- Edit below this comment -->


<!-- Pod2Wiki= -->
</div>
<!-- Pod2Wiki= -->
</div>


<!-- Pod2Wiki= -->
<!-- Pod2Wiki= -->
</div>
</div>
<!-- Pod2Wiki=item_verbatim -->
<!-- Pod2Wiki=item_verbatim -->
===$parser-&gt;verbatim( ... )===
===verbatim===


$parser-&gt;verbatim( $text, $line_num, $pod_para )
{{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.


Line 191: Line 147:
<!-- Edit below this comment -->
<!-- Edit below this comment -->


<!-- Pod2Wiki= -->
</div>
<!-- Pod2Wiki= -->
</div>


<!-- Pod2Wiki= -->
<!-- Pod2Wiki= -->
</div>
</div>
<!-- Pod2Wiki=item_textblock -->
<!-- Pod2Wiki=item_textblock -->
===$parser-&gt;textblock( ... )===
===textblock===


$parser-&gt;textblock( $text, $line_num, $pod_para )
{{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.


Line 209: Line 160:
<!-- Edit below this comment -->
<!-- Edit below this comment -->


<!-- Pod2Wiki= -->
</div>
<!-- Pod2Wiki= -->
</div>


<!-- Pod2Wiki= -->
<!-- Pod2Wiki= -->
</div>
</div>
<!-- Pod2Wiki=item_interpolate -->
<!-- Pod2Wiki=item_interpolate -->
===$parser-&gt;interpolate( ... )===
===interpolate===


$parser-&gt;interpolate( $text, $line_num )
{{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.


Line 227: Line 173:
<!-- Edit below this comment -->
<!-- Edit below this comment -->


<!-- Pod2Wiki= -->
</div>
<!-- Pod2Wiki= -->
</div>


<!-- Pod2Wiki= -->
<!-- Pod2Wiki= -->
</div>
</div>
<!-- Pod2Wiki=item_interior_sequence -->
<!-- Pod2Wiki=item_interior_sequence -->
===$parser-&gt;interior_sequence( ... )===
===interior_sequence===


$parser-&gt;interior_sequence( $seq_cmd, $seq_arg, $pod_seq )
{{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.


Line 248: Line 189:
<!-- Pod2Wiki= -->
<!-- Pod2Wiki= -->
</div>
</div>
<!-- Pod2Wiki=head_copyright -->
==COPYRIGHT==
{{API:Copyright}}
<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= -->
<!-- Pod2Wiki= -->
</div>
</div>
<!-- Pod2Wiki=_postamble_ --><!-- Edit below this comment -->
<!-- Pod2Wiki=_postamble_ --><!-- Edit below this comment -->

Latest revision as of 08:46, 15 December 2021

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


NAME[edit]

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

User Comments


Editing Pod2Wiki Pages[edit]

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[edit]

 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[edit]

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

User Comments


METHODS[edit]

User Comments


new[edit]

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[edit]

$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[edit]

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

Pod::Parser callback.

User Comments


verbatim[edit]

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

Pod::Parser callback.

User Comments


textblock[edit]

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

Pod::Parser callback.

User Comments


interpolate[edit]

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

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

User Comments


interior_sequence[edit]

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

Pod::Parser callback.

User Comments


COPYRIGHT[edit]

© Copyright 2000-2024 University of Southampton.

EPrints 3.4 is supplied by EPrints Services.

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

LICENSE[edit]

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