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)
-
Inherited, see "OVERLOADED" in OODoc::Object
- overload: 'bool'
-
Inherited, see "OVERLOADED" in OODoc::Object
- overload: 'cmp' (string comparison)
-
True when both object have same name. Numeric comparison operators check whether it is the same object: subtilly different.
METHODS
Extends "METHODS" in OODoc::Object.
Constructors
Extends "Constructors" in OODoc::Object.
- $class->new(%options)
-
Inherited, see "Constructors" in OODoc::Object
-Option --Default container <required> description <empty string> 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.
Attributes
Extends "Attributes" in OODoc::Object.
- $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->extends( [$object] )
-
Close to all elements used within OODoc can have an inheritance relation. The returned object is extended by the current object. Multiple inheritance is not supported here.
- $obj->linenr()
- $obj->manual()
-
The manual of the text object is returned.
- $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.
- $obj->unique()
-
Inherited, see "Attributes" in OODoc::Object
- $obj->where()
-
Returns the source of the text item: the filename name and the line number of the start of it.
Manual Repository
Extends "Manual Repository" in OODoc::Object.
- $obj->addManual($manual)
-
Inherited, see "Manual Repository" in OODoc::Object
- $obj->findManual($name)
-
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
- $obj->publicationIndex()
-
Inherited, see "Manual Repository" in OODoc::Object
- $obj->publish(\%options)
-
Inherited, see "Manual Repository" in OODoc::Object
Collected
- $obj->addExample($object)
-
Add a new example (an OODoc::Text::Example object) to the list already in this object. You can not search for a specific example, 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";
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().
SEE ALSO
This module is part of OODoc version 3.02, built on August 15, 2025. Website: https://perl.overmeer.net/oodoc/
LICENSE
For contributors see file ChangeLog.
This software is copyright (c) 2003-2025 by Mark Overmeer.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.