Texinfo::Convert::Utils
***********************

Texinfo::Convert::Utils NAME
============================

Texinfo::Convert::Utils - miscellaneous functions usable in all converters

Texinfo::Convert::Utils SYNOPSIS
================================

  use Texinfo::Convert::Utils qw(expand_today expand_verbatiminclude);

  my $today_tree = expand_today($converter);
  my $verbatiminclude_tree
     = expand_verbatiminclude(undef, $converter, $verbatiminclude);

Texinfo::Convert::Utils NOTES
=============================

The Texinfo Perl module main purpose is to be used in texi2any to convert Texinfo to other formats.  There is no promise of API stability.

Texinfo::Convert::Utils DESCRIPTION
===================================

miscellaneous methods that may be useful for backends converting texinfo trees.  This module contains the methods that can be used in converters that do not inherit Texinfo::Convert::Converter.

Texinfo::Convert::Utils METHODS
===============================

No method is exported in the default case.

Most methods takes a $converter as argument, in general optionally, to get some information and use methods for error reporting, see Texinfo::Convert::Converter and Texinfo::Report. On strings translations, see Texinfo::Translations.

$arguments = definition_arguments_content($element)

     $element should be a @def* Texinfo tree element.  Texinfo elements on the @-command line corresponding to arguments in the function definition are returned in the $arguments array reference. Arguments correspond to text following the category and the name on the @-command line.  If there is no argument, $arguments will be undef.

$tree = definition_category_tree($converter, $def_line)

     The $converter argument may be undef.  $def_line is a def_line texinfo tree container.  This function returns a texinfo tree corresponding to the category of the $def_line taking the class into account, if there is one. If $converter is not defined, the resulting string won't be translated.

($encoded_name, $encoding) = $converter->encoded_output_file_name($converter, $character_string_name)

     Encode $character_string_name in the same way as other file name are encoded in converters, based on customization variables, and possibly on the input file encoding.  Return the encoded name and the encoding used to encode the name.  The $converter argument is not optional and is used both to access to customization variables and to access to parser information.

$tree = expand_today($converter)

     Expand today's date, as a texinfo tree with translations.

$tree = expand_verbatiminclude($registrar, $customization_information, $verbatiminclude)

     The $registrar argument may be undef.  $verbatiminclude is a @verbatiminclude tree element.  This function returns a @verbatim tree elements after finding the included file and reading it.  If $registrar is not defined, errors messages are not registered.

(\@contents, \@accent_commands) = find_innermost_accent_contents($element)

     $element should be an accent command Texinfo tree element.  Returns an array reference containing the innermost accent command contents, normally a text element with one or two letter, and an array reference containing the accent commands nested in $element (including $element).

$result = add_heading_number($converter, $heading_element, $heading_text, $do_number)

     The $converter argument may be undef.  $heading_element is a heading command tree element.  $heading_text is the already formatted heading text.  if the $do_number optional argument is defined and false, no number is used and the text is returned as is. This function returns the heading with a number and the appendix part if needed.  If $converter is not defined, the resulting string won't be translated.

Texinfo::Convert::Utils SEE ALSO
================================

Texinfo::Convert::Converter and Texinfo::Translations.

Texinfo::Convert::Utils AUTHOR
==============================

Patrice Dumas, <pertusus@free.fr>

Texinfo::Convert::Utils 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.