The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

OODoc::Text::Structure - set of paragraphs with examples and subroutines

INHERITANCE

 OODoc::Text::Structure
   is a OODoc::Text
   is a OODoc::Object

 OODoc::Text::Structure is extended by
   OODoc::Text::Chapter
   OODoc::Text::Section
   OODoc::Text::SubSection

SYNOPSIS

 # Cannot be instantiated itself

DESCRIPTION

The OODoc::Text::Structure class is used as base class for the OODoc::Text::Chapter, OODoc::Text::Section, and OODoc::Text::SubSection classes. Each of these classes group some paragraphs of text, probably some examples and some subroutines: they provide a structure to the document.

OVERLOADED

overload: '""' (stringification)

overload: '==' and '!='

overload: 'cmp' (string comparison)

METHODS

Constructors

$obj->emptyExtension(CONTAINER)

    Create an empty copy of a structured text element, which is used at a higher level of inheritance to collect related subroutines and such.

OODoc::Text::Structure->new(OPTIONS)

     Option       Defined in       Default   
     container    L<OODoc::Text>   <required>
     description  L<OODoc::Text>   C<''>     
     level                         <required>
     linenr       L<OODoc::Text>   <required>
     name         L<OODoc::Text>   undef     
     type         L<OODoc::Text>   <required>

    . container OBJECT

    . description STRING

    . level INTEGER

      Header level of the text structure. A chapter will be 1, section 2, and subsection 3.

    . linenr INTEGER

    . name STRING

    . type STRING

Inheritance knowledge

$obj->extends([OBJECT])

Attributes

$obj->container([OBJECT])

$obj->description

$obj->level

    Returns the level of the text structure. Like in pod and html, a chapter will be 1, section 2, and subsection 3.

$obj->name

$obj->niceName

    Returns the name of this chapter, section or sub-section beautified to normal caps. If the name does not contain lower-case characters, then the whole string is lower-cased, and then the first upper-cased.

$obj->type

Location

$obj->findEntry(NAME)

    Find the chapter, section or subsection with this NAME. The object found is returned.

$obj->manual([NAME])

$obj->path

    Represent the location of this chapter, section, or subsection as one string, separated by slashes.

    Example:

     print $subsect->path; 
        # may print:  METHODS/Container/Search

$obj->unique

$obj->where

Collected

$obj->all(METHOD, PARAMETERS)

    Call the METHOD recursively on this object and all its sub-structures. For instance, when all is called on a chapter, it first will call the METHOD on that chapter, than on all its sections and subsections. The PARAMETERS are passed with each call. The results of all calls is returned as list.

$obj->example(OBJECT)

$obj->examples

$obj->findDescriptionObject

$obj->isEmpty

    Return true if this text structure is only a place holder for something found in a super class. Structured elements are created with emptyExtension() on each sub-class pass the idea of order and to collect subroutines to be listed. However, in some cases, nothing is to be listed after all, and in that case, this method returns true.

    Example:

     unless($chapter->isEmpty) ...

$obj->openDescription

Subroutines

Each manual page structure element (chapter, section, and subsection) can contain a list of subroutine descriptions.

$obj->addSubroutine(OBJECTS)

    A subroutine (OODoc::Text::Subroutine object) is added to the chapter, section or subsection.

$obj->setSubroutines(ARRAY)

    Sets the subroutines which are related to this text structure, replacing the preivous set. This is used when the manual pages are expanded into each-other to simplify working with the inheritance relations.

$obj->subroutine(NAME)

    Returns the subroutine with the specific name.

$obj->subroutines

    Returns the list of subroutines which are related to this text object.

Commonly used functions

$obj->filenameToPackage(FILENAME)

OODoc::Text::Structure->filenameToPackage(FILENAME)

$obj->mkdirhier(DIRECTORY)

OODoc::Text::Structure->mkdirhier(DIRECTORY)

Manual Repository

$obj->addManual(MANUAL)

$obj->mainManual(NAME)

$obj->manuals

$obj->manualsForPackage(NAME)

$obj->packageNames

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 level defined for structural component

REFERENCES

See the OODoc website at http://perl.overmeer.net/oodoc/ for more details.

COPYRIGHTS

Module version 0.06. Written by Mark Overmeer (mark@overmeer.net). See the ChangeLog for other contributors.

Copyright (c) 2003 by the author(s). All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.