9.1.4 Type Tree Element Conversion Functions

User defined functions called for the conversion of an element without @-command with text or a container type are registered with texinfo_register_type_formatting. For containers, the user defined function is called after conversion of the content.

Function: texinfo_register_type_formatting ($type, \&handler)

$type is the element type. \&handler is the user defined function reference.

The call of the user defined functions is:

Function Reference: $text type_conversion ($converter, $type, \%element, $content)

$converter is a converter object. $type is the element type. \%element is the Texinfo element. $content is text for elements associated with text, or the formatted contents for other elements. $content can be undef or the empty string.

The $text returned is the result of the @-command conversion.

To call a conversion function from user defined code, the function reference should first be retrieved using type_conversion:

Function: \&type_conversion = $converter->type_conversion ($type)

$type is the element type. Returns the conversion function reference for $type, or ‘undef’ if there is none, which should only be the case for types ignored in HTML not defined by the user.

It is possible to have access to the default conversion function reference. The function used is:

Function: \&default_type_conversion = $converter->default_type_conversion ($type)

$type is the element type. Returns the default conversion function reference for $type, or ‘undef’ if there is none, which should only be the case for types ignored in HTML.