a'} and $element->{'extra'}->{'part_associated_section'}) and !Texinfo::Common::is_content_empty($element)) { $result .= "\n"; } my $level_adjusted_cmdname = Texinfo::Structuring::section_level_adjusted_command_name($element); if (!($element->{'extra'} and $element->{'extra'}->{'section_childs'} and scalar(@{$element->{'extra'}->{'section_childs'}})) or $level_adjusted_cmdname eq 'top') { $result .= "\n"; pop @{$self->{'lang_stack'}}; my $current = $element; while ($current->{'extra'} and $current->{'extra'}->{'section_directions'} and $current->{'extra'}->{'section_directions'}->{'up'} # the most up element is a virtual sectioning root element, this # condition avoids getting into it and $current->{'extra'}->{'section_directions'}->{'up'}->{'cmdname'} and !$current->{'extra'}->{'section_directions'}->{'next'} and Texinfo::Structuring::section_level_adjusted_command_name( $current->{'extra'}->{'section_directions'}->{'up'}) ne 'top') { $current = $current->{'extra'}->{'section_directions'}->{'up'}; $result .= '\n"; pop @{$self->{'lang_stack'}}; } } } elsif ($element->{'type'} and $element->{'type'} eq 'before_node_section') { # ignore text before the first @node or sectioning command # as DocBook does not allow content not within some semantic # markup return ''; } if ($cmdname and $Texinfo::Commands::root_commands{$cmdname} and defined($self->{'in_skipped_node_top'}) and $self->{'in_skipped_node_top'} == 1) { return ''; } #warn " returning $result\n"; return $result; } # figure: mandatory title->use it with shortcaption?. Has a caption. 1; __END__ # Automatically generated from maintain/template.pod =head1 NAME Texinfo::Convert::DocBook - Convert Texinfo tree to DocBook =head1 SYNOPSIS my $converter = Texinfo::Convert::DocBook->converter({'NUMBER_SECTIONS' => 0}); $converter->output($document); $converter->convert($document); $converter->convert_tree($tree); =head1 NOTES The Texinfo Perl module main purpose is to be used in C to convert Texinfo to other formats. There is no promise of API stability. =head1 DESCRIPTION Texinfo::Convert::DocBook converts a Texinfo tree to DocBook. =head1 METHODS =over =item $converter = Texinfo::Convert::DocBook->converter($options) Initialize converter from Texinfo to DocBook. The I<$options> hash reference holds Texinfo customization options for the converter. These options should be Texinfo customization options that can be passed to the converter. Most of the customization options are described in the Texinfo manual or in the customization API manual. Those customization options, when appropriate, override the document content. See L for more information. =item $converter->output($document) Convert a Texinfo parsed document I<$document> and output the result in files as described in the Texinfo manual. =item $result = $converter->convert($document) Convert a Texinfo parsed document I<$document> and return the resulting output. =item $result = $converter->convert_tree($tree) Convert a Texinfo tree portion I<$tree> and return the resulting output. This function does not try to output a full document but only portions. For a full document use C. In general, this function should be called after the converter has been associated to a document by a call to C or C. =back =head1 AUTHOR Patrice Dumas, Epertusus@free.frE =head1 COPYRIGHT AND LICENSE Copyright 2010- Free Software Foundation, Inc. See the source file for all copyright years. This library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. =cut