Doku-Base
Texi2html Linux Dokumentation
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.12 Definition commands formatting

The formatting of definition commands is controlled by a hash and four functions. The hash describes how the text on the definition line is interpreted, the functions control the formatting of the definition line and the definition function text.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.12.1 Customizing the interpretation of a definition line

The keys of the hash %def_map are definition command names. There are two types of entries:

  • If the command is a shortcut for another definition command the value is a text and the definition command is replaced by the text.

    For example if we have:

     
    $def_map{'deftruc'} = '@defvr {A truc}';
    

    and a line like

     
    @deftruc var
    

    the line will be transformed in

     
    @defvr {A truc} var
    
  • If the command isn't a shortcut, it is associated with an array reference. The first element is ‘f’, ‘v’ or ‘t’ corresponding with the index type (‘f’ for function, ‘v’ for variable, ‘t’ for type).

    The remaining of the array describes how to interpret the text following the definition command on the definition command line. The entry item specify what corresponds with the next bracketed item or word. Currently the possibilities are ‘category’, ‘name’, ‘type’, ‘class’ and ‘arg’.

    For example if we have

     
    def_map{'defvr'} = [ 'v', 'category', 'name' ];
    

    The first bracketed item following @defvr is considered to be the category and the next one is the name. The index associated with the definition line is the variables index.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

7.12.2 Customization of the definition formatting

Four functions are used when formatting a definition command:

category name
Function Reference: $category definition_category $category_or_name $class $style

This function precise a category or an index entry name associating a class $class (if given) with $category_or_name. The $style of the definition may be ‘f’, for function, ‘v’, for variable or ‘t’, for type.

formatting of the definition line
Function Reference: $line def_line $category $name $type $arguments $index_label

This function formats the definition line. $category is the category formatted with $definition_category, $name, $type and arguments are the element of the definition line. $index_label is the text inserted at the place where an index entry appears. See section Formatting of index entries.

definition text
Function Reference: $definition_text def_item $text

This function formats the definition text, $text.

the whole definition
Function Reference: $definition def $text

This function formats the whole definition. The definition line and text formatted by the above functions are in $text.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]


Doku-Base

This document was created by Netzdino using texi2html.