Commits

shl...@52c325ad-5fd0-0310-8a0f-c43feede02cc  committed 0e626be

Docmake: added the "rtf" target.

  • Participants
  • Parent commits d26047b

Comments (0)

Files changed (1)

File modules/App-XML-DocBook-Docmake/lib/App/XML/DocBook/Docmake.pm

     'xhtml' =>
     {
     },
+    'rtf' =>
+    {
+        xslt_mode => "fo",
+    },
     'pdf' =>
     {
         xslt_mode => "fo",
     help - this help screen.
     
     fo - convert to XSL-FO.
+    rtf - convert to RTF (MS Word).
     pdf - convert to PDF (Adobe Acrobat).
     xhtml - convert to XHTML.
 EOF
     );
 }
 
+sub _run_mode_rtf
+{
+    my $self = shift;
+
+    my $xslt_output_path = $self->_output_path();
+
+    $xslt_output_path =~ s{\.([^\.]*)\z}{\.fo}ms;
+
+    $self->_run_xslt({output_path => $xslt_output_path});
+
+    return $self->_exec_command(
+        [
+            "fop",
+            "-rtf", $self->_output_path(),
+            $xslt_output_path,
+        ],
+    );
+}
+
 =head1 AUTHOR
 
 Shlomi Fish, C<< <shlomif at cpan.org> >>