NAME

OODoc::Text - text component as found in a manual

INHERITANCE

OODoc::Text
  is an OODoc::Object

OODoc::Text is extended by
  OODoc::Text::Default
  OODoc::Text::Diagnostic
  OODoc::Text::Example
  OODoc::Text::Option
  OODoc::Text::Structure
  OODoc::Text::Subroutine

SYNOPSIS

# Cannot be instantiated itself

DESCRIPTION

The parsers (implemented in the OODoc::Parser classes) scan the documentation as written down by the author of the module, and build a tree of these OODoc::Text objects from it. Then, any formatter (implemented by the OODoc::Format classes) can take this tree of text objects and convert it into manual pages.

Extends "DESCRIPTION" in OODoc::Object.

OVERLOADED

Extends "OVERLOADED" in OODoc::Object.

overload: '""' <$stringification>

Returned is the name of the text object.

overload: '==' $and '!='

Numeric comparison is used to compare to objects whether they are identical. String comparison is overloaded to compare the names of the objects.

overload: 'cmp' <$string $comparison>

Names are compared.

METHODS

Extends "METHODS" in OODoc::Object.

Constructors

Extends "Constructors" in OODoc::Object.

OODoc::Text->new(%options)
-Option     --Default
 container    <required>
 description  ''
 linenr       <required>
 name         undef
 type         <required>
container => OBJECT

All text objects except chapters are contained in some other object.

description => STRING

The text which is contained in the body of this text item. Often, this is filled in later by openDescription().

linenr => INTEGER
name => STRING

The name contains the main data about the text piece.

type => STRING

The type of this text element. This is used for debugging only.

Inheritance knowledge

Extends "Inheritance knowledge" in OODoc::Object.

$obj->extends( [$object] )

Inherited, see "Inheritance knowledge" in OODoc::Object

Attributes

$obj->container( [$object] )

The text element which encapsulates the text element at hand. This defines the structure of the documentation. Only for chapters, this value will be undefined.

$obj->description()

Returns the description text for this object. Nearly all objects contains some kind of introductory description.

$obj->name()

The name of this text element. Stringification is overloaded to call this name method.

example:

print $text->name;
print $text;   # via overload
$obj->type()

Returns the type name of this data object.

Location

$obj->manual( [$name] )

Without a $name, the manual of the text object is returned. With a $name, the manual with that name is returned, even when that does not have a relation to the object: it calls OODoc::Object::manual().

$obj->unique()

Returns a unique id for this text item. This is the easiest way to see whether two references to the same (overloaded) objects point to the same thing. The ids are numeric.

example:

if($obj1->unique == $obj2->unique) {...}
if($obj1 == $obj2) {...}   # same via overload
$obj->where()

Returns the source of the text item: the filename name and the line number of the start of it.

Collected

$obj->example($object)

Add a new example (a OODoc::Text::Example object) to the list already in this object. You can not look for a specific because they have no real name (only a sequence number).

$obj->examples()

Returns a list of all examples contained in this text element.

$obj->findDescriptionObject()

From the current object, search in the extends until an object is found which has a content for the description field.

$obj->openDescription()

Returns a reference to the scalar which will contain the description for this object.

example:

my $descr = $text->openDescription;
$$descr  .= "add a line\n";

Commonly used functions

Extends "Commonly used functions" in OODoc::Object.

$obj->filenameToPackage($filename)
OODoc::Text->filenameToPackage($filename)

Inherited, see "Commonly used functions" in OODoc::Object

$obj->mkdirhier($directory)
OODoc::Text->mkdirhier($directory)

Inherited, see "Commonly used functions" in OODoc::Object

Manual Repository

Extends "Manual Repository" in OODoc::Object.

$obj->addManual($manual)

Inherited, see "Manual Repository" in OODoc::Object

$obj->mainManual($name)

Inherited, see "Manual Repository" in OODoc::Object

$obj->manuals()

Inherited, see "Manual Repository" in OODoc::Object

$obj->manualsForPackage($name)

Inherited, see "Manual Repository" in OODoc::Object

$obj->packageNames()

Inherited, see "Manual Repository" in OODoc::Object

DIAGNOSTICS

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().

Error: no text container specified for the $type object

Each text element is encapsulated by an other text element, except chapters. A value must be known for this container option to define the elements relative location.

SEE ALSO

This module is part of OODoc distribution version 2.02, built on December 08, 2021. Website: http://perl.overmeer.net/oodoc/

LICENSE

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

This program is free software; you can redistribute it and/or modify it under the Artistic license. See http://dev.perl.org/licenses/artistic.html