blib/lib/Liveman/MinillaPod2Markdown.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 12 | 12 | 100.0 |
branch | 1 | 2 | 50.0 |
condition | n/a | ||
subroutine | 4 | 4 | 100.0 |
pod | 3 | 3 | 100.0 |
total | 20 | 21 | 95.2 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Liveman::MinillaPod2Markdown; 2: # Обманка для Minilla, чтобы скопировать Module в README.md 3: 4: use parent qw/Pod::Markdown/; 5: 6: sub new { bless {}, __PACKAGE__ } 7: 8: sub parse_from_file { 9: my ($self, $path) = @_; 10: $self->{path} = $path =~ s!\.pm$!.md!r; 11: $self 12: } 13: 14: sub as_markdown { 15: my ($self) = @_; 16: open my $f, "<:utf8", $self->{path} or die "Not open file $self->{path}!"; 17: read $f, my $buf, -s $f; 18: close $f; 19: $buf 20: } 21: 22: 1; 23: 24: __END__ 25: 26: =encoding utf-8 27: 28: =head1 NAME 29: 30: Liveman::MinillaPod2Markdown - bung for Minilla. It not make README.md 31: 32: =head1 SYNOPSIS 33: 34: use Liveman::MinillaPod2Markdown; 35: 36: my $mark = Liveman::MinillaPod2Markdown->new; 37: 38: $mark->isa("Pod::Markdown") # -> 1 39: 40: open my $f, ">", "X.md" or die "X.md: $!"; print $f "hi!"; close $f; 41: 42: $mark->parse_from_file("X.pm"); 43: $mark->{path} # => X.md 44: 45: $mark->as_markdown # => hi! 46: 47: =head1 DESCRIPION 48: 49: Add C<markdown_maker = "Liveman::MinillaPod2Markdown"> to C<minil.toml>, and Minilla do'nt make README.md. 50: 51: =head1 SUBROUTINES 52: 53: =head2 as_markdown () 54: 55: The bung. 56: 57: =head2 new () 58: 59: The constructor. 60: 61: =head2 parse_from_file ($path) 62: 63: The bung. 64: 65: =head1 INSTALL 66: 67: For install this module in your system run next LL<https://metacpan.org/pod/App::cpm>: 68: 69: sudo cpm install -gvv Liveman::MinillaPod2Markdown 70: 71: =head1 AUTHOR 72: 73: Yaroslav O. Kosmina LL<mailto:darviarush@mail.ru> 74: 75: =head1 LICENSE 76: 77: ⚖ B<GPLv3> 78: 79: =head1 COPYRIGHT 80: 81: The Liveman::MinillaPod2Markdown module is copyright © 2023 Yaroslav O. Kosmina. Rusland. All rights reserved. 82: |