| 1 | # | ||||||||||||||||||||||||||||
| 2 | # This file is part of Markdown::Pod::Embed. | ||||||||||||||||||||||||||||
| 3 | # | ||||||||||||||||||||||||||||
| 4 | # This software is copyright (c) 2026 by Andrew Speer <andrew.speer@isolutions.com.au>. | ||||||||||||||||||||||||||||
| 5 | # | ||||||||||||||||||||||||||||
| 6 | # This is free software; you can redistribute it and/or modify it under | ||||||||||||||||||||||||||||
| 7 | # the same terms as the Perl 5 programming language system itself. | ||||||||||||||||||||||||||||
| 8 | # | ||||||||||||||||||||||||||||
| 9 | # Full license text is available at: | ||||||||||||||||||||||||||||
| 10 | # | ||||||||||||||||||||||||||||
| 11 | # <http://dev.perl.org/licenses/> | ||||||||||||||||||||||||||||
| 12 | # | ||||||||||||||||||||||||||||
| 13 | package Markdown::Pod::Embed::Constant; | ||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | # Compiler pragma and package variables | ||||||||||||||||||||||||||||
| 17 | # | ||||||||||||||||||||||||||||
| 18 | 8 | ▶ | use strict qw(vars); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 19 | 8 | ▶ | use vars qw($VERSION @ISA @EXPORT $OPTION_HR $PANDOC_EXE | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 20 | 8 | $PANDOC_CMD_MD2TEXT_CR); | |||||||||||||||||||||||||||
| 21 | 8 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | # External packages | ||||||||||||||||||||||||||||
| 25 | # | ||||||||||||||||||||||||||||
| 26 | 8 | ▶ | use Config; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 27 | 8 | ▶ | use Exporter; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 28 | 8 | ▶ | use File::Spec; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | # Version and exports | ||||||||||||||||||||||||||||
| 32 | # | ||||||||||||||||||||||||||||
| 33 | 8 | $VERSION='1.011'; | |||||||||||||||||||||||||||
| 34 | 8 | @ISA=qw(Exporter); | |||||||||||||||||||||||||||
| 35 | 8 | @EXPORT=qw($OPTION_HR $PANDOC_EXE $PANDOC_CMD_MD2TEXT_CR); | |||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | |||||||||||||||||||||||||||||
| 38 | # Default processor options | ||||||||||||||||||||||||||||
| 39 | # | ||||||||||||||||||||||||||||
| 40 | 8 | $OPTION_HR={dialect => 'GitHub'}; | |||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | # Find Pandoc when it is available for plain-text rendering | ||||||||||||||||||||||||||||
| 44 | # | ||||||||||||||||||||||||||||
| 45 | 8 | $PANDOC_EXE=''; | |||||||||||||||||||||||||||
| 46 | 8 | foreach my $dir (File::Spec->path()) { | |||||||||||||||||||||||||||
| 47 | 80 | foreach my $name (qw(pandoc pandoc.exe)) { | |||||||||||||||||||||||||||
| 48 | 160 | my $fn=File::Spec->catfile($dir, $name); | |||||||||||||||||||||||||||
| 49 | 160 | ▶ | if (-f $fn && -x $fn) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
-f $fn and -x $fn
MC/DC0%0/2
-f $fn and -x $fn
-f $fn
-x $fn
Truth table33%1/3
A and B
A= -f $fnB= -x $fn
| |||||||||||||||||||||||||||||
| 50 | 0 | $PANDOC_EXE=$fn; | |||||||||||||||||||||||||||
| 51 | 0 | last; | |||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||
| 53 | } | ||||||||||||||||||||||||||||
| 54 | 80 | ▶ | last if $PANDOC_EXE; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 55 | } | ||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||
| 58 | # Construct the Markdown-to-text Pandoc command | ||||||||||||||||||||||||||||
| 59 | # | ||||||||||||||||||||||||||||
| 60 | 0 | ▶ | $PANDOC_CMD_MD2TEXT_CR=sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 61 | 0 | return [shift(), '-f', 'gfm', '-t', 'plain', shift()]; | |||||||||||||||||||||||||||
| 62 | 8 | }; | |||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||
| 64 | |||||||||||||||||||||||||||||
| 65 | # Done | ||||||||||||||||||||||||||||
| 66 | # | ||||||||||||||||||||||||||||
| 67 | 8 | 1; | |||||||||||||||||||||||||||
| 68 | __END__ | ||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||
| 70 | =begin markdown | ||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | # NAME | ||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||
| 74 | Markdown::Pod::Embed::Constant - internal defaults for Markdown::Pod::Embed | ||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||
| 76 | # DESCRIPTION | ||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||
| 78 | This module supplies the default Markdown dialect and discovers Pandoc for | ||||||||||||||||||||||||||||
| 79 | plain-text rendering. It is used by `Markdown::Pod::Embed` and its command-line | ||||||||||||||||||||||||||||
| 80 | utility; applications should configure the processor through its constructor. | ||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||
| 82 | # SEE ALSO | ||||||||||||||||||||||||||||
| 83 | |||||||||||||||||||||||||||||
| 84 | `Markdown::Pod::Embed`, `markpod` | ||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||
| 86 | # AUTHOR | ||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||
| 88 | Andrew Speer <andrew.speer@isolutions.com.au> | ||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||
| 90 | # LICENSE and COPYRIGHT | ||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||
| 92 | This file is part of Markdown::Pod::Embed. | ||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||
| 94 | This software is copyright (c) 2026 by Andrew Speer <andrew.speer@isolutions.com.au>. | ||||||||||||||||||||||||||||
| 95 | |||||||||||||||||||||||||||||
| 96 | This is free software; you can redistribute it and/or modify it under | ||||||||||||||||||||||||||||
| 97 | the same terms as the Perl 5 programming language system itself. | ||||||||||||||||||||||||||||
| 98 | |||||||||||||||||||||||||||||
| 99 | Full license text is available at: | ||||||||||||||||||||||||||||
| 100 | |||||||||||||||||||||||||||||
| 101 | <http://dev.perl.org/licenses/> | ||||||||||||||||||||||||||||
| 102 | |||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||
| 104 | =end markdown | ||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||
| 107 | =head1 NAME | ||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||
| 109 | Markdown::Pod::Embed::Constant - internal defaults for Markdown::Pod::Embed | ||||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||
| 111 | |||||||||||||||||||||||||||||
| 112 | =head1 DESCRIPTION | ||||||||||||||||||||||||||||
| 113 | |||||||||||||||||||||||||||||
| 114 | This module supplies the default Markdown dialect and discovers Pandoc for | ||||||||||||||||||||||||||||
| 115 | plain-text rendering. It is used by C<Markdown::Pod::Embed> and its command-line | ||||||||||||||||||||||||||||
| 116 | utility; applications should configure the processor through its constructor. | ||||||||||||||||||||||||||||
| 117 | |||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||
| 119 | =head1 SEE ALSO | ||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||
| 121 | C<Markdown::Pod::Embed>, C<markpod> | ||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||
| 123 | |||||||||||||||||||||||||||||
| 124 | =head1 AUTHOR | ||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||
| 126 | Andrew Speer L<mailto:andrew.speer@isolutions.com.au> | ||||||||||||||||||||||||||||
| 127 | |||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||
| 129 | =head1 LICENSE AND COPYRIGHT | ||||||||||||||||||||||||||||
| 130 | |||||||||||||||||||||||||||||
| 131 | This software is copyright (c) 2026 by Andrew Speer. It may be distributed | ||||||||||||||||||||||||||||
| 132 | under the same terms as Perl itself. | ||||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||
| 134 | =cut | ||||||||||||||||||||||||||||