Pod::Weaver::Plugin::Include::Finder - Finds source Pods in .pod files or modules.
version v0.1.9
use Pod::Weaver::Plugin::Include::Finder; my $finder = Pod::Weaver::Plugin::Include::Finder->new; my $template = $finder->get_template( template => 'tmplName', source => 'source.pod', );
This module loads sources, parses them and caches templates found.
Cache of templates by sources. Hash of hashes where first level keys are sources by their full file names; and second level keys are template names. Each cache entry is an array of Pod nodes.
Mapping of short names into full path names. Short names are either aliases or what is used with a =include command. For example:
=include
=srcAlias alias Some::Module =include template@templates/src.pod
With these commands the map will contain keys alias and templates/src.pod.
Back reference to a Pod::Weaver::Plugin::Include instance.
List of entries from pod_path configuration variable.
pod_path
Takes a short source name (not alias!) and returns full path name for it or undef if not found.
Successful search is stored into maps attribute.
maps
Finds out the full path name for $source and stores a new entry for $alias in maps attribute. Does nothing if source is not found.
$source
$alias
NOTE: This method will result in two maps entries: one for the $source and one for the $alias.
Returns full path name of the $source.
Parses argument of =tmpl command. Returns a profile hash with two keys:
=tmpl
hidden
Boolean, true if template is declared hidden.
name
Template name.
load_file( $file )
Loads and parses a source file defined by $file. The result is stored into cache.
$file
cache
Returns true if file has been successully read by Pod::Elemental.
get_template( %opts )
Returns a cached template. %opts profile can have two keys:
%opts
template
Template name
source
Source in short form including aliases.
If a template is missing in the cache then tries to load_file().
load_file()
Returns undef if failed.
Initializer for cache attribute.
Initilizer for maps attribute.
Initializer for pod_path attribute.
Initializer for logger attribute. Takes logger object either from callerPlugin or creates a new one.
Solely for use by load_file() and _store_template() methods.
_store_template()
Records a new template into the cache.
Vadim Belman <vrurg@cpan.org>
This software is copyright (c) 2017 by Vadim Belman.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Pod::Weaver::Plugin::Include, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Pod::Weaver::Plugin::Include
CPAN shell
perl -MCPAN -e shell install Pod::Weaver::Plugin::Include
For more information on module installation, please visit the detailed CPAN module installation guide.