| 1 | #!/usr/bin/env perl | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use 5.014; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 1 | ▶ | use XML::Grammar::Screenplay::FromProto::API::ListImages (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 1 | ▶ | use XML::Grammar::Screenplay::FromProto::Parser::QnD (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | 1 | ▶ | use Getopt::Long qw/ GetOptions /; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | 1 | my $output_fn; | |||||||||
| 13 | 1 | my $show_fn = ''; | |||||||||
| 14 | 1 | GetOptions( "output|o=s" => \$output_fn, 'with-filename!' => \$show_fn, ); | |||||||||
| 15 | |||||||||||
| 16 | 1 | my $image_lister = | |||||||||
| 17 | XML::Grammar::Screenplay::FromProto::API::ListImages->new( {} ); | ||||||||||
| 18 | |||||||||||
| 19 | 1 | foreach my $fn (@ARGV) | |||||||||
| 20 | { | ||||||||||
| 21 | 1 | my $got_doc = $image_lister->calc_doc__from_proto_text( | |||||||||
| 22 | { | ||||||||||
| 23 | source => { | ||||||||||
| 24 | file => $fn, | ||||||||||
| 25 | }, | ||||||||||
| 26 | } | ||||||||||
| 27 | ); | ||||||||||
| 28 | |||||||||||
| 29 | 1 | foreach my $img ( @{ $got_doc->list_images() } ) | |||||||||
| 30 | { | ||||||||||
| 31 | 3 | ▶ | if ($show_fn) | ||||||||
|
Branch: 1 branch
| |||||||||||
| 32 | { | ||||||||||
| 33 | 0 | print $fn, ":"; | |||||||||
| 34 | } | ||||||||||
| 35 | 3 | say $img->uri(); | |||||||||
| 36 | } | ||||||||||
| 37 | } | ||||||||||
| 38 | |||||||||||
| 39 | 1; | ||||||||||
| 40 | |||||||||||
| 41 | __END__ | ||||||||||
| 42 | |||||||||||
| 43 | =pod | ||||||||||
| 44 | |||||||||||
| 45 | =encoding UTF-8 | ||||||||||
| 46 | |||||||||||
| 47 | =head1 NAME | ||||||||||
| 48 | |||||||||||
| 49 | screenplay-text--list-images - list images | ||||||||||
| 50 | |||||||||||
| 51 | =head1 VERSION | ||||||||||
| 52 | |||||||||||
| 53 | version 0.22.0 | ||||||||||
| 54 | |||||||||||
| 55 | =head1 SYNOPSIS | ||||||||||
| 56 | |||||||||||
| 57 | screenplay-text--list-images --with-filename -- t/screenplay/data/proto-text/*.txt | ||||||||||
| 58 | |||||||||||
| 59 | =head1 DESCRIPTION | ||||||||||
| 60 | |||||||||||
| 61 | $ screenplay-text--list-images --with-filename -- t/screenplay/data/proto-text/*.txt | ||||||||||
| 62 | t/screenplay/data/proto-text/with-img-element-as-whole-para.txt:sling.png | ||||||||||
| 63 | t/screenplay/data/proto-text/with-img-element-inside-paragraphs.txt:sling.png | ||||||||||
| 64 | t/screenplay/data/proto-text/with-multiple-img-elements.txt:david.webp | ||||||||||
| 65 | t/screenplay/data/proto-text/with-multiple-img-elements.txt:sling.png | ||||||||||
| 66 | t/screenplay/data/proto-text/with-multiple-img-elements.txt:zebra.jpg | ||||||||||
| 67 | |||||||||||
| 68 | =head2 | ||||||||||
| 69 | |||||||||||
| 70 | =for :stopwords cpan testmatrix url bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan | ||||||||||
| 71 | |||||||||||
| 72 | =head1 SUPPORT | ||||||||||
| 73 | |||||||||||
| 74 | =head2 Websites | ||||||||||
| 75 | |||||||||||
| 76 | The following websites have more information about this module, and may be of help to you. As always, | ||||||||||
| 77 | in addition to those websites please use your favorite search engine to discover more resources. | ||||||||||
| 78 | |||||||||||
| 79 | =over 4 | ||||||||||
| 80 | |||||||||||
| 81 | =item * | ||||||||||
| 82 | |||||||||||
| 83 | MetaCPAN | ||||||||||
| 84 | |||||||||||
| 85 | A modern, open-source CPAN search engine, useful to view POD in HTML format. | ||||||||||
| 86 | |||||||||||
| 87 | L<https://metacpan.org/release/XML-Grammar-Fiction> | ||||||||||
| 88 | |||||||||||
| 89 | =item * | ||||||||||
| 90 | |||||||||||
| 91 | RT: CPAN's Bug Tracker | ||||||||||
| 92 | |||||||||||
| 93 | The RT ( Request Tracker ) website is the default bug/issue tracking system for CPAN. | ||||||||||
| 94 | |||||||||||
| 95 | L<https://rt.cpan.org/Public/Dist/Display.html?Name=XML-Grammar-Fiction> | ||||||||||
| 96 | |||||||||||
| 97 | =item * | ||||||||||
| 98 | |||||||||||
| 99 | CPANTS | ||||||||||
| 100 | |||||||||||
| 101 | The CPANTS is a website that analyzes the Kwalitee ( code metrics ) of a distribution. | ||||||||||
| 102 | |||||||||||
| 103 | L<http://cpants.cpanauthors.org/dist/XML-Grammar-Fiction> | ||||||||||
| 104 | |||||||||||
| 105 | =item * | ||||||||||
| 106 | |||||||||||
| 107 | CPAN Testers | ||||||||||
| 108 | |||||||||||
| 109 | The CPAN Testers is a network of smoke testers who run automated tests on uploaded CPAN distributions. | ||||||||||
| 110 | |||||||||||
| 111 | L<http://www.cpantesters.org/distro/X/XML-Grammar-Fiction> | ||||||||||
| 112 | |||||||||||
| 113 | =item * | ||||||||||
| 114 | |||||||||||
| 115 | CPAN Testers Matrix | ||||||||||
| 116 | |||||||||||
| 117 | The CPAN Testers Matrix is a website that provides a visual overview of the test results for a distribution on various Perls/platforms. | ||||||||||
| 118 | |||||||||||
| 119 | L<http://matrix.cpantesters.org/?dist=XML-Grammar-Fiction> | ||||||||||
| 120 | |||||||||||
| 121 | =item * | ||||||||||
| 122 | |||||||||||
| 123 | CPAN Testers Dependencies | ||||||||||
| 124 | |||||||||||
| 125 | The CPAN Testers Dependencies is a website that shows a chart of the test results of all dependencies for a distribution. | ||||||||||
| 126 | |||||||||||
| 127 | L<http://deps.cpantesters.org/?module=XML::Grammar::Fiction> | ||||||||||
| 128 | |||||||||||
| 129 | =back | ||||||||||
| 130 | |||||||||||
| 131 | =head2 Bugs / Feature Requests | ||||||||||
| 132 | |||||||||||
| 133 | Please report any bugs or feature requests by email to C<bug-xml-grammar-fiction at rt.cpan.org>, or through | ||||||||||
| 134 | the web interface at L<https://rt.cpan.org/Public/Bug/Report.html?Queue=XML-Grammar-Fiction>. You will be automatically notified of any | ||||||||||
| 135 | progress on the request by the system. | ||||||||||
| 136 | |||||||||||
| 137 | =head2 Source Code | ||||||||||
| 138 | |||||||||||
| 139 | The code is open to the world, and available for you to hack on. Please feel free to browse it and play | ||||||||||
| 140 | with it, or whatever. If you want to contribute patches, please send me a diff or prod me to pull | ||||||||||
| 141 | from your repository :) | ||||||||||
| 142 | |||||||||||
| 143 | L<https://github.com/shlomif/fiction-xml> | ||||||||||
| 144 | |||||||||||
| 145 | git clone git://github.com/shlomif/fiction-xml.git | ||||||||||
| 146 | |||||||||||
| 147 | =head1 AUTHOR | ||||||||||
| 148 | |||||||||||
| 149 | Shlomi Fish <shlomif@cpan.org> | ||||||||||
| 150 | |||||||||||
| 151 | =head1 BUGS | ||||||||||
| 152 | |||||||||||
| 153 | Please report any bugs or feature requests on the bugtracker website | ||||||||||
| 154 | L<https://github.com/shlomif/fiction-xml/issues> | ||||||||||
| 155 | |||||||||||
| 156 | When submitting a bug or request, please include a test-file or a | ||||||||||
| 157 | patch to an existing test-file that illustrates the bug or desired | ||||||||||
| 158 | feature. | ||||||||||
| 159 | |||||||||||
| 160 | =head1 COPYRIGHT AND LICENSE | ||||||||||
| 161 | |||||||||||
| 162 | This software is Copyright (c) 2007 by Shlomi Fish. | ||||||||||
| 163 | |||||||||||
| 164 | This is free software, licensed under: | ||||||||||
| 165 | |||||||||||
| 166 | The MIT (X11) License | ||||||||||
| 167 | |||||||||||
| 168 | =cut | ||||||||||