Next: Other Links, Headings and Associated Information for Special Elements, Previous: Getting Direction Strings, Up: Directions, Links, Labels and Files   [Contents][Index]


14.2 Target Commands Links, Texts and Associated Commands ¶

Target @-commands are @-commands that are associated with an identifier and can be linked to. They corresponds first to @-commands with unique identifier used as labels, @node, @anchor and @float. Sectioning commands, index entries and footnotes are also associated to targets.

To get the unique Texinfo tree element corresponding to a label, use label_command:

Function: \%element = $converter->label_command ($label) ¶

Return the element in the tree that $label refers to.

To get the identifier, file name and href of tree elements that may be used as link target, use command_id, command_filename and command_href:

Function: $identifier = $converter->command_id (\%target_element) ¶

Returns the id specific of the \%target_element tree element.

Function: $file_name = $converter->command_filename (\%target_element) ¶

Returns the file name of the \%target_element tree element.

Function: $href = $converter->command_href (\%target_element, $source_filename, $source_command, $specified_target) ¶

Return string for linking to \%target_element with <a href>. $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. $specified_target is an optional identifier that overrides the target identifier if set.

To get the text of tree elements that may be used as link description, use command_text:

Function: $result = $converter->command_text (\%target_element, $type) ¶

Return the information to be used for a hyperlink to \%target_element. The information returned depends on $type:

text

Return text.

tree

Return a Texinfo elements tree.

tree_nonumber

Return a Texinfo elements tree representing text without a chapter number being included.

string

Return text in string context. See Init File Expansion Contexts: Normal, Preformatted, Code, String, Math.

To get the top level element and the tree unit element associated to any Texinfo tree element, use get_element_root_command_element:

Function: \%top_level_element, \%element_unit = $converter->get_element_root_command_element (\%element) ¶

Return the top level element and tree element unit a Texinfo tree \%element is in (see Texinfo Tree Elements in User Defined Functions). Both the top level element and the tree element unit may be undefined, depending on how the converter is called and on the Texinfo tree. The top level element returned is also determined by the customization variable USE_NODES. If USE_NODES is set the @node is preferred, otherwise the sectioning command is preferred.

To obtain the top level command element associated with the target element, either a @node or a sectioning element, use command_root_element_command:

Function: \%top_level_element = $converter->command_root_element_command (\%target_element) ¶

Return the top level element \%target_element is in.

To get the node element associated with the target element, use command_node:

Function: \%node_element = $converter->command_node (\%target_element) ¶

Return the node element associated with \%target_element.


Next: Other Links, Headings and Associated Information for Special Elements, Previous: Getting Direction Strings, Up: Directions, Links, Labels and Files   [Contents][Index]