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