> From: Carlos Maniero <car...@maniero.me>
> Cc: Carlos Maniero <car...@maniero.me>
> Date: Wed, 20 Nov 2024 19:41:33 +0000 (UTC)
> 
> The HIGHLIGHT_SYNTAX is great and is suitable for most of the cases.
> However, since it works with a predefined set of supported programs it
> limits the user's options and requires the text2any to grow as new
> syntax highlighters emerge and may be sensible for highlighters *CLI*
> changes.
> 
> This change introduces a new *tex2any* variable that allows users to
> specify a highlighter program/script that receives the language as first
> argument and the code to be highlighted into the *stdin* and prints the
> result in the *stdout*.
> 
> Even that the source highlighting is experimental, this change does not
> deprecate the previous work, keeping backwards compatibility with the
> cost of the highlighter program variable to be called
> *HIGHLIGHT_SYNTAX_CMD*.

Thanks, but I don't think I understand why you need a new variable.
Just teach texi2any that some specially-formatted value of
HIGHLIGHT_SYNTAX means to use whatever program is specified by the
value.  For example, if the value is "(SOMETHING)", then SOMETHING is
the shell command to use.  We could also have placeholders for
command-line arguments, e.g. "(SOMETHING %i %o)" means invoke
SOMETHING with a single command-line argument where %i is substituted
by the name of a file with the code to be highlighted ("input") and %o
with the name of the file to write the results ("output").  Or some
other similar convention that is unlikely to conflict with the
already-existing values.

IOW, instead of introducing a new variable, why not extend the
existing one?

Thanks.

P.S. Btw, why wasn't this feature announced in any NEWS file?  AFAICT,
it exists since Texinfo 6.8, but is not mentioned in NEWS.  Perhaps it
should be mentioned in NEWS of the next release?

Reply via email to