logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Pod::Weaver::Role::StringFromComment - Extract a string from a specially formatted comment

Author

       Ricardo SIGNES <cpan@semiotic.systems>

Name

       Pod::Weaver::Role::StringFromComment - Extract a string from a specially formatted comment

Overview

       This role assists Pod::Weaver sections by allowing them to pull strings from the source comments
       formatted like:

           # KEYNAME: Some string...

       This is probably the most familiar to people using lines like the following to allow the Name section to
       determine a module's abstract:

           # ABSTRACT: Provides the HypnoToad with mind-control powers

       It will extract these strings by inspecting the "ppi_document" which must be given.

Perl Version

       This module should work on any version of perl still receiving updates from the Perl 5 Porters.  This
       means it should work on any version of perl released in the last two to three years.  (That is, if the
       most recently released version is v5.40, then this module should work on both v5.40 and v5.38.)

       Although it may work on older versions of perl, no guarantee is made that the minimum required version
       will not be increased.  The version may be increased for any reason, and there is no promise that patches
       will be accepted to lower the minimum required perl.

Private Methods

       This role supplies only methods meant to be used internally by its consumer.

   _extract_comment_content($ppi_doc,$key)
       Given a key, try to find a comment matching "# $key:" in the $ppi_document and return everything but the
       prefix.

       e.g., given a document with a comment in it of the form:

           # ABSTRACT: Yada yada...

       ...and this is called...

           $self->_extract_comment_content($ppi, 'ABSTRACT')

       ...it returns to us:

           Yada yada...

Version

       version 4.020

See Also