ASPEER-MakeMaker-Markdown-Pod

 view release on metacpan or  search on metacpan

LICENSE  view on Meta::CPAN

                            Preamble

  The license agreements of most software companies try to keep users
at the mercy of those companies.  By contrast, our General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users.  The
General Public License applies to the Free Software Foundation's
software and to any other program whose authors commit to using it.
You can use it for your programs, too.

  When we speak of free software, we are referring to freedom, not
price.  Specifically, the General Public License is designed to make
sure that you have the freedom to give away or sell copies of free
software, that you receive source code or can get it if you want it,
that you can change the software or use pieces of it in new free
programs; and that you know you can do these things.

  To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.

LICENSE  view on Meta::CPAN

Program or a portion of it, either verbatim or with modifications.  Each
licensee is addressed as "you".

  1. You may copy and distribute verbatim copies of the Program's source
code as you receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice and
disclaimer of warranty; keep intact all the notices that refer to this
General Public License and to the absence of any warranty; and give any
other recipients of the Program a copy of this General Public License
along with the Program.  You may charge a fee for the physical act of
transferring a copy.

  2. You may modify your copy or copies of the Program or any portion of
it, and copy and distribute such modifications under the terms of Paragraph
1 above, provided that you also do the following:

    a) cause the modified files to carry prominent notices stating that
    you changed the files and the date of any change; and

    b) cause the whole of any work that you distribute or publish, that
    in whole or in part contains the Program or any part thereof, either

LICENSE  view on Meta::CPAN


    c) If the modified program normally reads commands interactively when
    run, you must cause it, when started running for such interactive use
    in the simplest and most usual way, to print or display an
    announcement including an appropriate copyright notice and a notice
    that there is no warranty (or else, saying that you provide a
    warranty) and that users may redistribute the program under these
    conditions, and telling the user how to view a copy of this General
    Public License.

    d) You may charge a fee for the physical act of transferring a
    copy, and you may at your option offer warranty protection in
    exchange for a fee.

Mere aggregation of another independent work with the Program (or its
derivative) on a volume of a storage or distribution medium does not bring
the other work under the scope of these terms.

  3. You may copy and distribute the Program (or a portion or derivative of
it, under Paragraph 2) in object code or executable form under the terms of
Paragraphs 1 and 2 above provided that you also do one of the following:

LICENSE  view on Meta::CPAN

    years, to give any third party free (except for a nominal charge
    for the cost of distribution) a complete machine-readable copy of the
    corresponding source code, to be distributed under the terms of
    Paragraphs 1 and 2 above; or,

    c) accompany it with the information you received as to where the
    corresponding source code may be obtained.  (This alternative is
    allowed only for noncommercial distribution and only if you
    received the program in object code or executable form alone.)

Source code for a work means the preferred form of the work for making
modifications to it.  For an executable file, complete source code means
all the source code for all modules it contains; but, as a special
exception, it need not include source code for modules which are standard
libraries that accompany the operating system on which the executable
file runs, or for standard header files or definitions files that
accompany that operating system.

  4. You may not copy, modify, sublicense, distribute or transfer the
Program except as expressly provided under this General Public License.
Any attempt otherwise to copy, modify, sublicense, distribute or transfer

SECURITY.md  view on Meta::CPAN

This policy was updated on 2026-09-26.

## Reporting a Security Vulnerability

Please report security vulnerabilities via GitHub private vulnerability
reporting for this repository:

https://github.com/aspeer/pm-ASPEER-MakeMaker-Markdown-Pod/security/advisories/new

GitHub private vulnerability reporting is enabled for this repository and is
the preferred reporting point.

If you cannot use GitHub, report the issue privately by email to the current
project maintainer:

Andrew Speer <andrew.speer@isolutions.com.au>

Please do not report security vulnerabilities through public GitHub issues,
public pull requests, RT, mailing lists, social media, chat channels, or other
public forums.

lib/ASPEER/MakeMaker/Markdown/Pod.pm  view on Meta::CPAN


# PROCESSOR COMPATIBILITY

For compatibility with earlier releases, this package inherits the processing
methods supplied by `Markdown::Pod::Embed`. New code that only converts or
updates Markdown/POD should use `Markdown::Pod::Embed` directly; it does not
need MakeMaker and does not install MakeMaker hooks.

# ERRORS

MakeMaker hook errors and target failures are fatal. Importing this module from
a program other than `Makefile.PL` does not alter `ExtUtils::MakeMaker`.

# SEE ALSO

`ASPEER::MakeMaker`, `ASPEER::MakeMaker::Markdown::Pod::MM`,
`ASPEER::MakeMaker::MM::Import`,
`Markdown::Pod::Embed`, `ExtUtils::MakeMaker`

# AUTHOR

lib/ASPEER/MakeMaker/Markdown/Pod.pm  view on Meta::CPAN

=head1 PROCESSOR COMPATIBILITY

For compatibility with earlier releases, this package inherits the processing
methods supplied by C<Markdown::Pod::Embed>. New code that only converts or
updates Markdown/POD should use C<Markdown::Pod::Embed> directly; it does not
need MakeMaker and does not install MakeMaker hooks.


=head1 ERRORS

MakeMaker hook errors and target failures are fatal. Importing this module from
a program other than C<Makefile.PL> does not alter C<ExtUtils::MakeMaker>.


=head1 SEE ALSO

C<ASPEER::MakeMaker>, C<ASPEER::MakeMaker::Markdown::Pod::MM>,
C<ASPEER::MakeMaker::MM::Import>,
C<Markdown::Pod::Embed>, C<ExtUtils::MakeMaker>


lib/ASPEER/MakeMaker/Markdown/Pod.pm.md  view on Meta::CPAN


# PROCESSOR COMPATIBILITY

For compatibility with earlier releases, this package inherits the processing
methods supplied by `Markdown::Pod::Embed`. New code that only converts or
updates Markdown/POD should use `Markdown::Pod::Embed` directly; it does not
need MakeMaker and does not install MakeMaker hooks.

# ERRORS

MakeMaker hook errors and target failures are fatal. Importing this module from
a program other than `Makefile.PL` does not alter `ExtUtils::MakeMaker`.

# SEE ALSO

`ASPEER::MakeMaker`, `ASPEER::MakeMaker::Markdown::Pod::MM`,
`ASPEER::MakeMaker::MM::Import`,
`Markdown::Pod::Embed`, `ExtUtils::MakeMaker`

# AUTHOR

lib/ASPEER/MakeMaker/Markdown/Pod/Constant.pm  view on Meta::CPAN


    PANDOC_CMD_MD2TEXT_CR => sub {
        return [
            shift(),                # PANDOC_EXE
            '-fmarkdown_github',    # from markdown (github dialect)
            '-tplain',              # to plaintext
            shift(),                # File name
        ]
    },

    #  Local constants override anything above
    #
    %{do($local_fn) || {}},
    %{do(glob(sprintf('~/.%s.local', __PACKAGE__))) || {}}    # || {} avoids warning

);


#  Export constants to namespace, place in export tags
#
require Exporter;

lib/ASPEER/MakeMaker/Markdown/Pod/Constant.pm  view on Meta::CPAN

my $pandoc          = $PANDOC_EXE;
my $cmd             = $PANDOC_CMD_MD2TEXT_CR->($pandoc, '-');
```

# DESCRIPTION

`ASPEER::MakeMaker::Markdown::Pod::Constant` defines exported constants used by the core
processor and command-line tool.

The constants are stored in `%Constant`, exported as package variables, and can
be overridden by local configuration files loaded at compile time.

# CONSTANTS

`$OPTION_HR`
: Default processor options. The current default Markdown dialect is `GitHub`.

`$PANDOC_EXE`
: Path to `pandoc` discovered from `PATH`, or an empty string when `pandoc` is
  not available.

lib/ASPEER/MakeMaker/Markdown/Pod/Constant.pm  view on Meta::CPAN

```perl
my $path = ASPEER::MakeMaker::Markdown::Pod::Constant::bin_find(qw(pandoc pandoc.exe));
```

Searches `PATH` for the first executable-like file matching one of the supplied
names and returns a canonical path. If no candidate is found, it returns an
empty string.

# LOCAL OVERRIDES

Local constants can be overridden by files loaded from:

```text
lib/ASPEER/MakeMaker/Markdown/Pod/Constant.pm.local
~/.ASPEER::MakeMaker::Markdown::Pod::Constant.local
```

Those files are expected to return a hash reference suitable for merging into
`%Constant`.

# SEE ALSO

lib/ASPEER/MakeMaker/Markdown/Pod/Constant.pm  view on Meta::CPAN

 my $default_dialect = $OPTION_HR->{dialect};
 my $pandoc          = $PANDOC_EXE;
 my $cmd             = $PANDOC_CMD_MD2TEXT_CR->($pandoc, '-');

=head1 DESCRIPTION

C<ASPEER::MakeMaker::Markdown::Pod::Constant> defines exported constants used by the core
processor and command-line tool.

The constants are stored in C<%Constant>, exported as package variables, and can
be overridden by local configuration files loaded at compile time.


=head1 CONSTANTS

C<$OPTION_HR>
: Default processor options. The current default Markdown dialect is C<GitHub>.

C<$PANDOC_EXE>
: Path to C<pandoc> discovered from C<PATH>, or an empty string when C<pandoc> is
  not available.

lib/ASPEER/MakeMaker/Markdown/Pod/Constant.pm  view on Meta::CPAN



 my $path = ASPEER::MakeMaker::Markdown::Pod::Constant::bin_find(qw(pandoc pandoc.exe));
Searches C<PATH> for the first executable-like file matching one of the supplied
names and returns a canonical path. If no candidate is found, it returns an
empty string.


=head1 LOCAL OVERRIDES

Local constants can be overridden by files loaded from:


 lib/ASPEER/MakeMaker/Markdown/Pod/Constant.pm.local
 ~/.ASPEER::MakeMaker::Markdown::Pod::Constant.local
Those files are expected to return a hash reference suitable for merging into
C<%Constant>.


=head1 SEE ALSO

lib/ASPEER/MakeMaker/Markdown/Pod/Constant.pm.md  view on Meta::CPAN

my $pandoc          = $PANDOC_EXE;
my $cmd             = $PANDOC_CMD_MD2TEXT_CR->($pandoc, '-');
```

# DESCRIPTION

`ASPEER::MakeMaker::Markdown::Pod::Constant` defines exported constants used by the core
processor and command-line tool.

The constants are stored in `%Constant`, exported as package variables, and can
be overridden by local configuration files loaded at compile time.

# CONSTANTS

`$OPTION_HR`
: Default processor options. The current default Markdown dialect is `GitHub`.

`$PANDOC_EXE`
: Path to `pandoc` discovered from `PATH`, or an empty string when `pandoc` is
  not available.

lib/ASPEER/MakeMaker/Markdown/Pod/Constant.pm.md  view on Meta::CPAN

```perl
my $path = ASPEER::MakeMaker::Markdown::Pod::Constant::bin_find(qw(pandoc pandoc.exe));
```

Searches `PATH` for the first executable-like file matching one of the supplied
names and returns a canonical path. If no candidate is found, it returns an
empty string.

# LOCAL OVERRIDES

Local constants can be overridden by files loaded from:

```text
lib/ASPEER/MakeMaker/Markdown/Pod/Constant.pm.local
~/.ASPEER::MakeMaker::Markdown::Pod::Constant.local
```

Those files are expected to return a hash reference suitable for merging into
`%Constant`.

# SEE ALSO

lib/ASPEER/MakeMaker/Markdown/Pod/MM.pm  view on Meta::CPAN

    my $source_fn;


    #  Use an existing Markdown README when one is available
    #
    if (-f $readme_md_fn) {
        $source_fn=$readme_md_fn;
        $md=slurp($readme_md_fn);
    }
    elsif (-e $readme_md_fn || -l $readme_md_fn) {
        return err("$readme_md_fn exists and is not a regular file");
    }
    elsif (-e $readme_fn || -l $readme_fn) {
        verbose('markpod: %s exists without %s, leaving both unchanged', $readme_fn, $readme_md_fn);
        return undef;
    }
    else {
        unless (defined $version_from_fn && length $version_from_fn) {
            verbose('markpod: no VERSION_FROM file, no README files created');
            return undef;
        }
        $md=$markpod_or->markpod_markdown_source($version_from_fn);
        unless (defined $md && length $md) {
            msg('markpod: %s -> %s: skipped, no markdown source', $version_from_fn, $readme_fn);
            return undef;
        }
        my $readme_md=$md;
        $readme_md.=$/ unless $readme_md=~/\n\z/;
        blurp($readme_md_fn, $readme_md) ||
            return err();
        push @manifest_add, $readme_md_fn unless exists $manifest_hr->{$readme_md_fn};
        $source_fn=$readme_md_fn;
    }
    msg('markpod: %s -> %s: starting render', $source_fn, $readme_fn);


    #  No markdown means nothing to render
    #
    unless (defined $md && length $md) {
        msg('markpod: %s -> %s: finished, skipped empty markdown source', $source_fn, $readme_fn);

lib/ASPEER/MakeMaker/Markdown/Pod/MM.pm  view on Meta::CPAN

    #  Convert markdown to text
    #
    my $text=$markpod_or->markpod_markdown_text($md);


    #  Update README only when changed
    #
    my $existing_readme=-f $readme_fn ? slurp($readme_fn) : '';
    if (md5_hex($existing_readme) ne md5_hex($text)) {
        $markpod_or->outfile($text, $readme_fn) ||
            return err();
        msg('markpod: %s -> %s: finished, updated', $source_fn, $readme_fn);
    }
    else {
        msg('markpod: %s -> %s: finished, no changes', $source_fn, $readme_fn);
    }

    push @manifest_add, $readme_fn unless exists $manifest_hr->{$readme_fn};
    manifest_add(\@manifest_add) if @manifest_add;

}

lib/ASPEER/MakeMaker/Markdown/Pod/MM/Constant.pm  view on Meta::CPAN

        "$(LICENSE)"
        "$(AUTHOR)"
        "$(TO_INST_PM)"
        "$(EXE_FILES)"
        "$(DIST_DEFAULT_TARGET)"
        "$(SUFFIX)"
        "$(ABSTRACT_FROM)"
    ]),


    #  Local constants override anything above
    #
    %{do($local_fn) || {}},
    %{do(glob(sprintf('~/.%s.local', __PACKAGE__))) || {}}    # || {} avoids warning

);


#  Export constants to namespace, place in export tags
#
require Exporter;

lib/ASPEER/MakeMaker/Markdown/Pod/MM/Constant.pm  view on Meta::CPAN

`$MARKPOD_PM`
: Module name invoked by the generated Makefile targets. This is normally
  `ASPEER::MakeMaker::Markdown::Pod::MM`.

`$MARKPOD_PM_ARGV`
: Quoted list of MakeMaker variables passed to the target dispatcher so methods
  such as `doc` and `readme` can reconstruct their input parameters.

# LOCAL OVERRIDES

Local constants can be overridden by files loaded from:

```text
lib/ASPEER/MakeMaker/Markdown/Pod/MM/Constant.pm.local
~/.ASPEER::MakeMaker::Markdown::Pod::MM::Constant.local
```

Those files are expected to return a hash reference suitable for merging into
`%Constant`.

# SEE ALSO

lib/ASPEER/MakeMaker/Markdown/Pod/MM/Constant.pm  view on Meta::CPAN

: Module name invoked by the generated Makefile targets. This is normally
  C<ASPEER::MakeMaker::Markdown::Pod::MM>.

C<$MARKPOD_PM_ARGV>
: Quoted list of MakeMaker variables passed to the target dispatcher so methods
  such as C<doc> and C<readme> can reconstruct their input parameters.


=head1 LOCAL OVERRIDES

Local constants can be overridden by files loaded from:


 lib/ASPEER/MakeMaker/Markdown/Pod/MM/Constant.pm.local
 ~/.ASPEER::MakeMaker::Markdown::Pod::MM::Constant.local
Those files are expected to return a hash reference suitable for merging into
C<%Constant>.


=head1 SEE ALSO

lib/ASPEER/MakeMaker/Markdown/Pod/MM/Constant.pm.md  view on Meta::CPAN

`$MARKPOD_PM`
: Module name invoked by the generated Makefile targets. This is normally
  `ASPEER::MakeMaker::Markdown::Pod::MM`.

`$MARKPOD_PM_ARGV`
: Quoted list of MakeMaker variables passed to the target dispatcher so methods
  such as `doc` and `readme` can reconstruct their input parameters.

# LOCAL OVERRIDES

Local constants can be overridden by files loaded from:

```text
lib/ASPEER/MakeMaker/Markdown/Pod/MM/Constant.pm.local
~/.ASPEER::MakeMaker::Markdown::Pod::MM::Constant.local
```

Those files are expected to return a hash reference suitable for merging into
`%Constant`.

# SEE ALSO

t/01-embed-process.t  view on Meta::CPAN

=end markdown
=cut
SIDE_EMBED_PM
    spew("${fn}.md", <<'SIDE_EMBED_MD');
# NAME

Sample::SidecarOverEmbedded - sidecar markdown
SIDE_EMBED_MD
    my $markpod_or=ASPEER::MakeMaker::Markdown::Pod->new({nobackup => 1});
    my $changed=$markpod_or->markpod_process($fn);
    ok($changed > 0, 'sidecar overrides embedded markdown');
    $markpod_or->markpod_inplace_update($fn);
    my $updated=slurp($fn);
    like($updated, qr/Sample::SidecarOverEmbedded - sidecar markdown/, 'sidecar markdown content embedded');
    unlike($updated, qr/Sample::SidecarOverEmbedded - embedded markdown/, 'embedded markdown content replaced');
}

{
    my $dir=tempdir(CLEANUP => 1);
    my $fn="${dir}/multi.pm";
    my $orig=<<'MULTI';



( run in 2.568 seconds using v1.01-cache-2.11-cpan-10df4c37326 )