++ed by:
BKB SYP

2 PAUSE users

Kevin Ryde

NAME

App::PodLinkCheck::ParseSections -- parse out section names from POD

SYNOPSIS

 use App::PodLinkCheck::ParseSections;

CLASS HIERARCHY

    Pod::Simple
      App::PodLinkCheck::ParseSections

DESCRIPTION

This is a POD parser used by App::PodLinkCheck to find section names in a document. Its behaviour is specific to PodLinkCheck but might have other use.

FUNCTIONS

$parser = App::PodLinkCheck::ParseSections->new($options_hashref)

Create and return a new parser object.

The default is to disable Pod::Simple whining about dubious pod, because App::PodLinkCheck is just meant to check links. $options_hashref can have verbose to give full messages from Pod::Simple.

    $parser = App::PodLinkCheck::ParseSections->new({ verbose => 1 });

It also works to set $parser->no_whining() as desired at any time.

$parser->parse_file($filename)

Parse the pod from $filename. All the various Pod::Simple parse input styles can be used too.

$hashref = $parser->sections_hashref()

Return a hashref of the names of POD sections seen by $parser. The keys are the section names. The values are true (presently just 1).

Sections names are mildly normalized by collapsing whitespace to a single space each and removing leading and trailing whitespace. Believe that's mostly how the pod formatters end up treating section names for linking purposes. (That sort of treatment being the intention here.)

The first word (of non-whitespace) of a section name is added as a hash entry too. This is in the style of Pod::Checker and is how the formatters help links to function names in for example perlfunc.

The section names accumulate everything seen by $parser. No attention is paid to any "Document" start etc. Usually a new App::PodLinkCheck::ParseSections is used for each file (unless some union of section names is in fact wanted).

SEE ALSO

App::PodLinkCheck, App::PodLinkCheck::ParseLinks

HOME PAGE

http://user42.tuxfamily.org/podlinkcheck/index.html

LICENSE

Copyright 2010, 2011, 2012, 2013, 2016 Kevin Ryde

PodLinkCheck is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

PodLinkCheck 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 General Public License for more details.

You should have received a copy of the GNU General Public License along with PodLinkCheck. If not, see <http://www.gnu.org/licenses/>.