texi2html
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Texi2html] Separate Processing of Preformatted Code Blocks


From: Patrice Dumas
Subject: Re: [Texi2html] Separate Processing of Preformatted Code Blocks
Date: Mon, 30 Mar 2009 11:47:14 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

On Sat, Mar 28, 2009 at 03:20:49PM +0200, Volkan YAZICI wrote:
> Hi,
> 
> I want  to feed contents in @lisp  ... @end blocks into  a separate perl
> function for  syntax highlighting and  some other extra  processing. For
> this purpose,  I overwrite  the my_preformatted() function  in texi2html
> init file.  But  I find out that, the  $text passed to my_preformatted()
> is already  HTML escaped,  and trying  to process that  data as  its the

Indeed, the way texi2html does is to process from the innermost to the
outermost. So you can, in general only change what is before and after 
already formatted text. However the inner formatting functions are 
aware of the context.

> original code  is pointless. Any  recommendations? Isn't it  possible to
> make texi2html handle preformatted text blocks in a separate way?

It really depends on what you want to do. Possible places for customizing 
what is done in preformatted formats are:

%simple_map_pre (simple commands like @@)
%pre_map        (commands with braces but no arg like @LaTeX{})
%style_map_pre  (@-commands with braces, like @emph{}, 
                 You may also directly change \&style)

Also a whole preformatted format formatting can be changed through 
$complex_format_map or \&complex_format. And of course there is 
\&preformatted.

Other formats have in general an argument that is set when in 
preformatted format, for example for \&normal_text, or \&menu_command,
or \&element_heading and many others.

If you want to do something different based on the topmost format
(that is something different in @lisp and @example) when formatting 
@-commands you could check what is on 
@{$Texi2HTML::THISDOC{'command_stack'}}
(which is sometimes given in argument of formatting functions, but
not always).

--
Pat




reply via email to

[Prev in Thread] Current Thread [Next in Thread]