The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

OODoc::Format::Pod - Produce POD pages from the doc tree

INHERITANCE

 OODoc::Format::Pod
   is a OODoc::Format
   is a OODoc::Object

 OODoc::Format::Pod is extended by
   OODoc::Format::Pod2
   OODoc::Format::Pod3

SYNOPSIS

 my $doc = OODoc->new(...);
 $doc->create
   ( 'pod'
   , format_options => [show_examples => 'NO']
   , append         => "extra text\n"
   );

DESCRIPTION

Create manual pages in the POD syntax. POD is the standard document description syntax for Perl. POD can be translated to many different operating system specific manual systems, like the Unix man system.

METHODS

Constructors

OODoc::Format::Pod->new(OPTIONS)

See "METHODS" in OODoc::Format

Inheritance knowledge

$obj->extends([OBJECT])

See "Inheritance knowledge" in OODoc::Object

Attributes

$obj->manifest()

See "Attributes" in OODoc::Format

$obj->project()

See "Attributes" in OODoc::Format

$obj->version()

See "Attributes" in OODoc::Format

$obj->workdir()

See "Attributes" in OODoc::Format

Page generation

$obj->cleanup(MANUAL, STRING)

See "Page generation" in OODoc::Format

$obj->cleanupPOD(IN, OUT)

The POD is produced in the specified IN filename, but may contain some garbage, especially a lot of superfluous blanks lines. Because it is quite complex to track double blank lines in the production process, we make an extra pass over the POD to remove it afterwards. Other clean-up activities may be implemented later.

$obj->createManual(OPTIONS)
 -Option        --Defined in     --Default
  append                           ''
  format_options  OODoc::Format    []
  manual          OODoc::Format    <required>
  project         OODoc::Format    <required>
  template        OODoc::Format    undef
append => STRING|CODE

Text to be added at the end of each manual page. See formatManual(append) for an explanation.

format_options => ARRAY
manual => MANUAL
project => STRING
template => LOCATION
$obj->createOtherPages(OPTIONS)

See "Page generation" in OODoc::Format

$obj->formatManual(OPTIONS)

The OPTIONS are a collection of all options available to show* methods. They are completed with the defaults set by createManual(format_options).

 -Option--Default
  append  ''
  manual  <required>
  output  <required>
append => STRING|CODE

Used after each manual page has been formatting according to the standard rules. When a STRING is specified, it will be appended to the manual page. When a CODE reference is given, that function is called with all the options that showChapter() usually gets.

Using append is one of the alternatives to create the correct Reference, Copyrights, etc chapters at the end of each manual page. See "Configuring".

manual => MANUAL
output => FILE
$obj->link(MANUAL, OBJECT, [TEXT])

Create the text for a link which refers to the OBJECT. The link will be shown somewhere in the MANUAL. The TEXT will be displayed is stead of the link path, when specified.

$obj->removeMarkup(STRING)

There is (AFAIK) no way to get the standard podlators code to remove all markup from a string: to simplify a string. On the other hand, you are not allowed to put markup in a verbatim block, but we do have that. So: we have to clean the strings ourselves.

$obj->showChapter(OPTIONS)

See "Page generation" in OODoc::Format

$obj->showChapterIndex(FILE, CHAPTER, INDENT)
$obj->showExamples(OPTIONS)

See "Page generation" in OODoc::Format

$obj->showOptionExpand(OPTIONS)

See "Page generation" in OODoc::Format

$obj->showOptionTable(OPTIONS)

See "Page generation" in OODoc::Format

$obj->showOptionUse(OPTIONS)

See "Page generation" in OODoc::Format

$obj->showOptionalChapter(NAME, OPTIONS)

See "Page generation" in OODoc::Format

$obj->showOptions(OPTIONS)

See "Page generation" in OODoc::Format

$obj->showRequiredChapter(NAME, OPTIONS)

See "Page generation" in OODoc::Format

$obj->showStructureExpanded(OPTIONS)

See "Page generation" in OODoc::Format

$obj->showStructureRefer(OPTIONS)

See "Page generation" in OODoc::Format

$obj->showSubroutine((@))

See "Page generation" in OODoc::Format

$obj->showSubroutineDescription(OPTIONS)

See "Page generation" in OODoc::Format

$obj->showSubroutineName(OPTIONS)

See "Page generation" in OODoc::Format

$obj->showSubroutineUse(OPTIONS)

See "Page generation" in OODoc::Format

$obj->showSubroutines(OPTIONS)

See "Page generation" in OODoc::Format

$obj->writeTable()
 -Option--Default
  ARRAY   <required>
  header  <required>
  output  <required>
  widths  undef
ARRAY => -OF-ARRAYS

An array of arrays, each describing a row for the output. The first row is the header.

header => ARRAY
output => FILE
widths => ARRAY

Commonly used functions

$obj->filenameToPackage(FILENAME)
OODoc::Format::Pod->filenameToPackage(FILENAME)

See "Commonly used functions" in OODoc::Object

$obj->mkdirhier(DIRECTORY)
OODoc::Format::Pod->mkdirhier(DIRECTORY)

See "Commonly used functions" in OODoc::Object

Manual Repository

$obj->addManual(MANUAL)

See "Manual Repository" in OODoc::Object

$obj->mainManual(NAME)

See "Manual Repository" in OODoc::Object

$obj->manual(NAME)

See "Manual Repository" in OODoc::Object

$obj->manuals()

See "Manual Repository" in OODoc::Object

$obj->manualsForPackage(NAME)

See "Manual Repository" in OODoc::Object

$obj->packageNames()

See "Manual Repository" in OODoc::Object

DETAILS

Configuring

Probably, the output which is produced by the POD formatter is only a bit in the direction of your own ideas, but not quite what you like. Therefore, there are a few ways to adapt the output.

Configuring with format options

createManual(format_options) or OODoc::create(format_options) can be used with a list of formatting options which are passed to showChapter(). This will help you to produce pages which have pre-planned changes in layout.

Configuring by appending

By default, the last chapters are not filled in: the REFERENCES and COPYRIGHTS chapters are very personal. You can fill these in by extending the POD generator, as described in the next section, or take a very simple approach simply using createManual(append).

Configuring via extension

OODoc is an object oriented module, which means that you can extend the functionality of a class by creating a new class. This provides an easy way to add, change or remove chapters from the produced manual pages.

Configuring with OODoc::Template

When using 'pod2' in stead of 'pod' when OODoc::create() is called, the OODoc::Format::Pod2 will be used. It's nearly a drop-in replacement by its default behavior. When you specify your own template file, every thing can be made.

DIAGNOSTICS

Error: cannot read prelimary pod from $infn: $!
Error: cannot write final pod to $outfn: $!
Error: cannot write pod manual at $manfile: $!
Error: formatter does not know the version.
Error: formatter has no project name.

A formatter was created without a name specified for the project at hand. This should be passed with new(project).

Error: manual definition requires manual object

A call to addManual() expects a new manual object (a OODoc::Manual), however an incompatible thing was passed. Usually, intended was a call to manualsForPackage() or mainManual().

Warning: missing required chapter $name in $manual
Error: no directory to put pod manual for $name in
Error: no package name for pod production
Error: no package name for pod production
Error: no working directory specified.

The formatter has to know where the output can be written. This directory must be provided via new(workdir), but was not specified.

Warning: unknown subroutine type $type for $name in $manual

SEE ALSO

This module is part of OODoc distribution version 2.00, built on January 11, 2013. Website: http://perl.overmeer.net/oodoc/

LICENSE

Copyrights 2003-2013 by [Mark Overmeer]. For other contributors see ChangeLog.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html