Difference between revisions of "API:EPrints/Test/Pod2Wiki"
Line 8: | Line 8: | ||
EPrints::Test::Pod2Wiki - convert EPrints pod to MediaWiki | EPrints::Test::Pod2Wiki - convert EPrints pod to MediaWiki | ||
− | |||
− | |||
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
<!-- Pod2Wiki= --> | <!-- Pod2Wiki= --> | ||
− | |||
<!-- 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> <!-- Pod2Wiki=head_synopsis --> | |
==SYNOPSIS== | ==SYNOPSIS== | ||
use EPrints::Test::Pod2Wiki; | use EPrints::Test::Pod2Wiki; | ||
Line 29: | Line 26: | ||
$p-&gt;update_page( "EPrints::Utils" ); | $p-&gt;update_page( "EPrints::Utils" ); | ||
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
− | <!-- Pod2Wiki= --> | + | <!-- Pod2Wiki= --></pre> |
− | + | ||
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> ... | |
<!-- Pod2Wiki=head_methods --> | <!-- Pod2Wiki=head_methods --> | ||
==METHODS== | ==METHODS== | ||
Line 42: | Line 39: | ||
This Wiki comment will be kept. | This Wiki comment will be kept. | ||
<!-- Pod2Wiki= --> | <!-- Pod2Wiki= --> | ||
− | ... | + | ...</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. | ||
− | |||
− | |||
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
<!-- Pod2Wiki= --> | <!-- Pod2Wiki= --> | ||
− | |||
<!-- Pod2Wiki=head_synopsis --> | <!-- Pod2Wiki=head_synopsis --> | ||
==SYNOPSIS== | ==SYNOPSIS== | ||
− | + | <source lang="perl">use EPrints::Test::Pod2Wiki; | |
− | + | ||
− | + | my $p = EPrints::Test::Pod2Wiki->new( | |
− | + | wiki_index => "http://wiki.foo.org/index.php", | |
− | + | username => "johnd", | |
− | + | password => "xiPi00", | |
− | + | ); | |
− | + | ||
− | + | $p->update_page( "EPrints::Utils" );</source> | |
− | + | ||
− | < | ||
− | |||
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
<!-- Pod2Wiki= --> | <!-- Pod2Wiki= --> | ||
− | |||
<!-- 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. | ||
− | |||
− | |||
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
<!-- Pod2Wiki= --> | <!-- Pod2Wiki= --> | ||
− | |||
<!-- Pod2Wiki=head_methods --> | <!-- Pod2Wiki=head_methods --> | ||
==METHODS== | ==METHODS== | ||
− | < | + | <!-- Pod2Wiki=head_new --> |
− | + | ===new=== | |
− | |||
− | |||
− | < | + | <source lang="perl">EPrints::Test::Pod2Wiki->new( ... ) |
− | |||
− | |||
− | |||
− | + | </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 | |
username - MediaWiki username | username - MediaWiki username | ||
password - MediaWiki password | password - MediaWiki password | ||
− | + | comments - "section", "none"</pre> | |
− | + | ||
− | |||
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
<!-- Pod2Wiki= --> | <!-- Pod2Wiki= --> | ||
− | + | <!-- Pod2Wiki=head_update_page --> | |
− | <!-- Pod2Wiki= | ||
===update_page=== | ===update_page=== | ||
− | + | <source lang="perl">$ok = $pod->update_page( $package_name ) | |
+ | |||
+ | </source> | ||
Update the MediaWiki page for $package_name. | Update the MediaWiki page for $package_name. | ||
− | |||
− | |||
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
<!-- Pod2Wiki= --> | <!-- Pod2Wiki= --> | ||
− | + | <!-- Pod2Wiki=head_command --> | |
− | <!-- Pod2Wiki= | ||
===command=== | ===command=== | ||
− | + | <source lang="perl">$parser->command( ... ) | |
+ | |||
+ | </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. | ||
− | |||
− | |||
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
<!-- Pod2Wiki= --> | <!-- Pod2Wiki= --> | ||
− | + | <!-- Pod2Wiki=head_verbatim --> | |
− | <!-- Pod2Wiki= | ||
===verbatim=== | ===verbatim=== | ||
− | + | <source lang="perl">$parser->verbatim( ... ) | |
+ | |||
+ | </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. | ||
− | |||
− | |||
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
<!-- Pod2Wiki= --> | <!-- Pod2Wiki= --> | ||
− | + | <!-- Pod2Wiki=head_textblock --> | |
− | <!-- Pod2Wiki= | ||
===textblock=== | ===textblock=== | ||
− | + | <source lang="perl">$parser->textblock( ... ) | |
+ | |||
+ | </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. | ||
− | |||
− | |||
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
<!-- Pod2Wiki= --> | <!-- Pod2Wiki= --> | ||
− | + | <!-- Pod2Wiki=head_interpolate --> | |
− | <!-- Pod2Wiki= | ||
===interpolate=== | ===interpolate=== | ||
− | + | <source lang="perl">$parser->interpolate( ... ) | |
+ | |||
+ | </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. | ||
− | |||
− | |||
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
<!-- Pod2Wiki= --> | <!-- Pod2Wiki= --> | ||
− | + | <!-- Pod2Wiki=head_interior_sequence --> | |
− | <!-- Pod2Wiki= | ||
===interior_sequence=== | ===interior_sequence=== | ||
− | + | <source lang="perl">$parser->interior_sequence( ... ) | |
+ | |||
+ | </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. | ||
− | |||
− | |||
<!-- Edit below this comment --> | <!-- Edit below this comment --> | ||
<!-- Pod2Wiki= --> | <!-- Pod2Wiki= --> | ||
− | |||
<!-- Pod2Wiki=head_copyright --> | <!-- Pod2Wiki=head_copyright --> | ||
==COPYRIGHT== | ==COPYRIGHT== | ||
− | + | Copyright 2000-2011 University of Southampton. | |
− | + | ||
+ | This file is part of EPrints http://www.eprints.org/. | ||
+ | |||
+ | 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_ --> | |
− | <!-- Pod2Wiki=_postamble_ --><!-- Edit below this comment --> | + | <!-- Edit below this comment --> |
Revision as of 09:56, 22 January 2013
EPrints 3 Reference: Directory Structure - Metadata Fields - Repository Configuration - XML Config Files - XML Export Format - EPrints data structure - Core API - Data Objects
Latest Source Code (3.4, 3.3) | Revision Log | Before editing this page please read Pod2Wiki
Contents
NAME
EPrints::Test::Pod2Wiki - convert EPrints pod to MediaWiki
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->new( wiki_index => "http://wiki.foo.org/index.php", username => "johnd", password => "xiPi00", ); $p->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.
SYNOPSIS
use EPrints::Test::Pod2Wiki;
my $p = EPrints::Test::Pod2Wiki->new(
wiki_index => "http://wiki.foo.org/index.php",
username => "johnd",
password => "xiPi00",
);
$p->update_page( "EPrints::Utils" );
DESCRIPTION
This module enables the integration of EPrints POD (documentation) and MediaWiki pages.
METHODS
new
EPrints::Test::Pod2Wiki->new( ... )
Create a new Pod2Wiki parser. Required options:
wiki_index - URL of the MediaWiki "index.php" page username - MediaWiki username password - MediaWiki password comments - "section", "none"
update_page
$ok = $pod->update_page( $package_name )
Update the MediaWiki page for $package_name.
command
$parser->command( ... )
Pod::Parser callback.
verbatim
$parser->verbatim( ... )
Pod::Parser callback.
textblock
$parser->textblock( ... )
Pod::Parser callback.
interpolate
$parser->interpolate( ... )
Pod::Parser callback. Overloaded to also escape HTML entities.
interior_sequence
$parser->interior_sequence( ... )
Pod::Parser callback.
COPYRIGHT
Copyright 2000-2011 University of Southampton.
This file is part of EPrints http://www.eprints.org/.
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/.