WARNING: This server is unstable and will be retired in the next days. If you want to keep this forum available, please request immediately a migration on the Nabble Support forum. Forums that don't receive any migration request will be deleted forever.

<code> tags in HTML

View: New views
2 Messages — Rating Filter:   Alert me  

<code> tags in HTML

by John Darrington-4 :: Rate this Message:

| View Threaded | Show Only this Message

Some of the non-english speaking PSPP users have been trying to use automatic
translation tools to read the HTML generated from the PSPP manual's Texinfo
source.

Apparently many such tools make a point of not attempting to translate text
between <CODE></CODE> tags.

So far as I can tell makeinfo only puts in such tags when it encounters @code
However much of our not-to-be-translated text is not in @code commands but in
@var, @samp, @display or @example environments.

Of course we could wrap absolutely everything in @code commands, but this seems
like a rather cumbersome approach.

Is it possible to tell the HTML generator to put <code> tags in for the other commands?

J'

--
PGP Public key ID: 1024D/2DE827B3
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See http://keys.gnupg.net or any PGP keyserver for public key.



signature.asc (196 bytes) Download Attachment

Re: <code> tags in HTML

by Patrice Dumas :: Rate this Message:

| View Threaded | Show Only this Message

On Fri, Mar 23, 2012 at 09:06:26AM +0000, John Darrington wrote:

> Some of the non-english speaking PSPP users have been trying to use automatic
> translation tools to read the HTML generated from the PSPP manual's Texinfo
> source.
>
> Apparently many such tools make a point of not attempting to translate text
> between <CODE></CODE> tags.
>
> So far as I can tell makeinfo only puts in such tags when it encounters @code
> However much of our not-to-be-translated text is not in @code commands but in
> @var, @samp, @display or @example environments.
>
> Of course we could wrap absolutely everything in @code commands, but this seems
> like a rather cumbersome approach.
>
> Is it possible to tell the HTML generator to put <code> tags in for the other commands?

With the new parser/converter, it is not that hard to change the
formatting.  Something like (in an init file)


  use vars qw(%style_commands_formatting);

  $style_commands_formatting{'normal'}->{'samp'}->{'attribute'} = 'code';

For @display or @example, it is a bit more complicated, something like

  sub add_code_in_preformatted ($$$$)
  {
    my $self = shift;
    my $cmdname = shift;
    my $command = shift;
    my $content = shift;

    return
      &{$self->default_types_conversion($cmdname)}($self,
          $cmdname, $command, '<code>'.$content.'</code>');
  }

  texinfo_register_type_formatting('preformatted', \&add_code_in_preformatted);



Subject to change and undocumented...

--
Pat