On Mon, Jul 20, 2009 at 02:38:13PM +0200, Reinhold Kainhofer wrote:
> Hi Patrice,
> In our lilypond docs, we have several texinfo comments, most notably the git 
> revision of the texinfo document, which would make sense to be converted into 
> html comments (so that we can e.g. determine from which revision a document 
> was compiled, which is particularly useful for translators). 
> 
> I've taken a quick look at the texi2html code, but I couldn't find the spot 
> where @c lines are ignored.
> 
> Can you think of an easy way to convert texinfo comments into html comments?

First this recently changed in cvs, so you should use the cvs version.

Then I think you could redefine $misc_command_line to be like:

sub comments_misc_commands($$$$$)
{
   my $macro = shift;
   my $line = shift;
   my $args = shift;
   my $stack = shift;
   my $state = shift;

   return ($macro, $line, undef) unless ($macro eq 'comment' or $macro eq 'c');
   my $comment_line = $args->[0];
   chomp ($comment_line);
   $comment_line =~ s/^\s//;
   my $result_text = &$comment ($comment_line);
   return ($macro, $line, $result_text);
}



> PS: Sometimes it might even make sense to convert @ignore...@end ignore 
> blocks 
> to html comments. Is there a way for this, too? (Actually, our git revisions 

I think you could try something along:

$texi_formats_map->{'ignore'} = 'raw';

And then modify $raw to use &$comments() when format is 'ignore'. I can
give more help if needed.

--
Pat


Reply via email to