12.3 Setting Up Content for the Next Text Container

Text is mainly output in two inline text containers, paragraph for text in paragraph and preformatted for text in preformatted environments. The Texinfo code parsing makes sure that it is the case, to simplify conversion to formats which allow text only in specific environments such as HTML.

Formatted text may also be prepared based on information from Texinfo elements tree while out of the inline containers. For that case, functions allow to register pending inline formatted content, and get the content to be prepended in inline text containers.

Pending formatted content text is registered with register_pending_formatted_inline_content:

Function: $converter->register_pending_formatted_inline_content ($category, $content)

$content is the formatted content to be registered and output in the next inline container. $category is a indicator of the source of the formatted inline content, mostly used to cancel registered content if no inline container was seen.

Pending formatted content can (and should) be cancelled when it is known that there is no suitable inline container to be used to output the text. The function is cancel_pending_formatted_inline_content:

Function: $cancelled_content = $converter->cancel_pending_formatted_inline_content ($category)

Cancel the first $category pending formatted content text found. Returns undef if nothing was cancelled, and the cancelled content otherwise.

Pending formatted content is gathered by calling get_pending_formatted_inline_content. In the default case, this is done in inline containers opening code (see Type Tree Element Opening Functions).

Function: $content = $converter->get_pending_formatted_inline_content ()

Returns the concatenated pending content.

The inline containers get the content when they are opened, but are converted after the formatting of their contents. Two additional functions allow to associate pending content to an element, associate_pending_formatted_inline_content, and get the associated content, get_associated_formatted_inline_content. associate_pending_formatted_inline_content is normally called in inline container opening code, right after get_pending_formatted_inline_content, while get_associated_formatted_inline_content is called in the inline container conversion function (see Type Tree Element Conversion Functions).

Function: $converter->associate_pending_formatted_inline_content (\%element, $content)

Associate $content to the Texinfo tree element \%element.

Function: $content = $converter->get_associated_formatted_inline_content (\%element)

Get $content associated to the Texinfo tree element \%element.