blib/lib/XML/Grammar/Fiction/ToDocBook.pm

filter: Statementstmt 86.6% 13 / 15 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 90.0% 18 / 20 CC 1 SCAR 0.6
CC
1
Cov
87%
BEGIN
1.3
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« blib/lib/XML/Grammar/Fiction/Struct/Tag.pm ↑ Summary blib/lib/XML/Grammar/Screenplay/ToDocBook.pm »
1 package XML::Grammar::Fiction::ToDocBook;
2 $XML::Grammar::Fiction::ToDocBook::VERSION = '0.22.4';
3 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 3 ▶use MooX 'late';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 3 ▶use XML::GrammarBase::Role::RelaxNG ();
Subroutine BEGIN: called CC=1 SCAR=0.0
9 3 ▶use XML::GrammarBase::Role::XSLT;
Subroutine BEGIN: called CC=1 SCAR=2.6
10  
11 with('XML::GrammarBase::Role::RelaxNG');
12 with XSLT( output_format => 'docbook' );
13  
14 has '+module_base' => ( default => 'XML-Grammar-Fiction' );
15 has '+rng_schema_basename' => ( default => 'fiction-xml.rng' );
16  
17 has '+to_docbook_xslt_transform_basename' =>
18 ( default => 'fiction-xml-to-docbook.xslt', );
19  
20  
21  
22  
23 sub translate_to_docbook
24 {
25 my ( $self, $args ) = @_;
26  
27 return $self->perform_xslt_translation(
28 { output_format => 'docbook', %{$args} } );
29 }
30  
31 1;
32  
33 __END__
34  
35 =pod
36  
37 =encoding UTF-8
38  
39 =head1 NAME
40  
41 XML::Grammar::Fiction::ToDocBook - module that converts the Fiction-XML to
42 DocBook 5.
43  
44 =head1 VERSION
45  
46 version 0.22.4
47  
48 =head1 METHODS
49  
50 =head2 new()
51  
52 Accepts no arguments so far. May take some time as the grammar is compiled
53 at that point.
54  
55 =head2 meta()
56  
57 Internal - (to settle pod-coverage.).
58  
59 =head2 xslt_transform_basename()
60  
61 Inherited - (to settle pod-coverage).
62  
63 =head2 perform_xslt_translation
64  
65 See L<XML::GrammarBase::Role::XSLT> . The output_format is C<'docbook'> .
66  
67 =head2 translate_to_docbook
68  
69 =over 4
70  
71 =item * my $xhtml_source = $converter->translate_to_docbook({source => {file => $filename}, output => "string" })
72  
73 =item * my $xhtml_source = $converter->translate_to_docbook({source => {string_ref => \$buffer}, output => "string" })
74  
75 =item * my $xhtml_dom = $converter->translate_to_docbook({source => {file => $filename}, output => "dom" })
76  
77 =item * my $xhtml_dom = $converter->translate_to_docbook({source => {dom => $libxml_dom}, output => "dom" })
78  
79 =back
80  
81 Does the actual conversion. The C<'source'> argument points to a hash-ref with
82 keys and values for the source. If C<'file'> is specified there it points to the
83 filename to translate (currently the only available source). If
84 C<'string_ref'> is specified it points to a reference to a string, with the
85 contents of the source XML. If C<'dom'> is specified then it points to an XML
86 DOM as parsed or constructed by XML::LibXML.
87  
88 The C<'output'> key specifies the return value. A value of C<'string'> returns
89 the XML as a string, and a value of C<'dom'> returns the XML as an
90 L<XML::LibXML> DOM object.
91  
92 =for :stopwords cpan testmatrix url bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan
93  
94 =head1 SUPPORT
95  
96 =head2 Websites
97  
98 The following websites have more information about this module, and may be of help to you. As always,
99 in addition to those websites please use your favorite search engine to discover more resources.
100  
101 =over 4
102  
103 =item *
104  
105 MetaCPAN
106  
107 A modern, open-source CPAN search engine, useful to view POD in HTML format.
108  
109 L<https://metacpan.org/release/XML-Grammar-Fiction>
110  
111 =item *
112  
113 RT: CPAN's Bug Tracker
114  
115 The RT ( Request Tracker ) website is the default bug/issue tracking system for CPAN.
116  
117 L<https://rt.cpan.org/Public/Dist/Display.html?Name=XML-Grammar-Fiction>
118  
119 =item *
120  
121 CPANTS
122  
123 The CPANTS is a website that analyzes the Kwalitee ( code metrics ) of a distribution.
124  
125 L<http://cpants.cpanauthors.org/dist/XML-Grammar-Fiction>
126  
127 =item *
128  
129 CPAN Testers
130  
131 The CPAN Testers is a network of smoke testers who run automated tests on uploaded CPAN distributions.
132  
133 L<http://www.cpantesters.org/distro/X/XML-Grammar-Fiction>
134  
135 =item *
136  
137 CPAN Testers Matrix
138  
139 The CPAN Testers Matrix is a website that provides a visual overview of the test results for a distribution on various Perls/platforms.
140  
141 L<http://matrix.cpantesters.org/?dist=XML-Grammar-Fiction>
142  
143 =item *
144  
145 CPAN Testers Dependencies
146  
147 The CPAN Testers Dependencies is a website that shows a chart of the test results of all dependencies for a distribution.
148  
149 L<http://deps.cpantesters.org/?module=XML::Grammar::Fiction>
150  
151 =back
152  
153 =head2 Bugs / Feature Requests
154  
155 Please report any bugs or feature requests by email to C<bug-xml-grammar-fiction at rt.cpan.org>, or through
156 the web interface at L<https://rt.cpan.org/Public/Bug/Report.html?Queue=XML-Grammar-Fiction>. You will be automatically notified of any
157 progress on the request by the system.
158  
159 =head2 Source Code
160  
161 The code is open to the world, and available for you to hack on. Please feel free to browse it and play
162 with it, or whatever. If you want to contribute patches, please send me a diff or prod me to pull
163 from your repository :)
164  
165 L<https://github.com/shlomif/fiction-xml>
166  
167 git clone git://github.com/shlomif/fiction-xml.git
168  
169 =head1 AUTHOR
170  
171 Shlomi Fish <shlomif@cpan.org>
172  
173 =head1 BUGS
174  
175 Please report any bugs or feature requests on the bugtracker website
176 L<https://github.com/shlomif/fiction-xml/issues>
177  
178 When submitting a bug or request, please include a test-file or a
179 patch to an existing test-file that illustrates the bug or desired
180 feature.
181  
182 =head1 COPYRIGHT AND LICENSE
183  
184 This software is Copyright (c) 2007 by Shlomi Fish.
185  
186 This is free software, licensed under:
187  
188 The MIT (X11) License
189  
190 =cut
« blib/lib/XML/Grammar/Fiction/Struct/Tag.pm ↑ Summary blib/lib/XML/Grammar/Screenplay/ToDocBook.pm »