Next: Navigation Panel and Navigation Header Formatting, Up: Customizing HTML Footers, Headers and Navigation Panels   [Contents][Index]


17.1 Navigation Panel Button Formatting ¶

The function reference format_button does the formatting of one button, corresponding, in general, to a link to a direction:

Function Reference: $formatted_button format_button ($converter, $button, $source_command) ¶

$button holds the specification of the button (see Buttons Display). $source_command is an optional argument, the @-command the link comes from.

Returns the formatted result in $formatted_button.

The buttons images can be formatted with format_button_icon_img (see below).

Simple navigation panel customization (see Simple Navigation Panel Customization), USE_ACCESSKEY, USE_REL_REV and direction strings customization (see Direction Strings Customization) can be relevant for the formatting of a button.

To get direction strings typically used for formatting of buttons or hyperrefs leading to that direction, use direction_string:

Function: $string = $converter->direction_string ($direction, $string_type, $context) ¶

Retrieve the $direction (see Directions) string of type $string_type (see Direction Strings). $context is ‘normal’ or ‘string’. See Init File Expansion Contexts: Normal, Preformatted, Code, String, Math. If $context is undef, the ‘normal’ context is assumed. The string will be translated if needed. May return undef.

To get the Texinfo special output unit associated with a special output unit direction, such as ‘About’ or ‘Contents’, as well as output unit associated with other global directions, such as ‘Top’ or ‘Index’, use use global_direction_unit:

Function: \%output_unit = $converter->global_direction_unit ($direction) ¶

Return the output unit associated with direction $direction, or undef if the direction is not a global output unit direction nor a special output unit direction or the associated special output unit is not output.

To get link information for relative and global directions, use from_element_direction:

Function: $result = $converter->from_element_direction ($direction, $type, $source_element, $source_filename, $source_command) ¶

Return a string for linking to $direction, or the information to be used for a hyperlink to $direction, depending on $type. The possible values for $type are described in Output Unit Direction Information Type.

$source_element is the output unit the link comes from. If not set, the current output unit is used. $source_filename is the file the link comes from. If not set, the current file name is used. $source_command is an optional argument, the @-command the link comes from. It is only used for messages.

format_button_icon_img formatting function can be redefined. In the default case, it is called for an active direction, if ICONS is set, when formatting a navigation panel button.

Function Reference: $text format_button_icon_img ($converter, $button, $icon, $name) ¶

$button is a button name, typically obtained from the button direction string (see Direction Strings). $icon is an image file name to be used as icon. $name is the direction heading, typically formatted in string context. See Init File Expansion Contexts: Normal, Preformatted, Code, String, Math.

Returns a formatted icon image.

See Directions for the list of directions.


Next: Navigation Panel and Navigation Header Formatting, Up: Customizing HTML Footers, Headers and Navigation Panels   [Contents][Index]