(I don't believe either Stefan nor Chong is on this list, so I cc them.
Stefan, Chong, this is a continuation of the gnu-prog-discuss thread.)
I am not Stefan, but in my view, this would be a horrible step
Texinfo is not simple to parse. There are macros, conditionals, unusual
argument parsing, and other source-level constructs to take into
account. Plus, the Texinfo language is not static, so there would be
new issues about "command @xyz is supported by program X but not program Y".
That whole area is bad enough as it is.
rms, years ago, you wrote something like this (it's been in the Texinfo
manual for ages):
If you are a programmer and would like to contribute to the GNU
project by implementing additional output formats for Texinfo, that
would be excellent. But please do not write a separate translator
texi2foo for your favorite format foo! That is the hard way to do the
job, and makes extra work in subsequent maintenance, since the Texinfo
language is continually being enhanced and updated.
It's just as true as it ever was, as far as I can see. One of the
biggest reasons why we have been working for years now to merge
texi2html's features into the main Texinfo distribution is so we can
avoid having to keep two Texinfo-reading programs (texi2html and
makeinfo) in sync. If Emacs (or whatever) becomes a Texinfo-reading
program, that effort will be fundamentally undermined.
These days, as I keep repeating to no apparent effect, another viable --
as far as I can see, the best -- approach is use the Texinfo XML output
as your input. This XML is an essentially complete representation of
the input, but without the Texinfo syntax and option peculiarities, as
The HTML output by (current) makeinfo is probably also a viable target
for Emacs (or whatever Info reader), but inevitably it would be less
general than the Texinfo XML. That is why it seems to that using the
XML to give yourself full control over the rendering would be the most
future-proof -- not dependent on whatever happens with HTML, not
dependent on whatever happens with Docbook.
P.S. If people still cannot resist the temptation of writing a new
program that reads Texinfo source directly, at a minimum, please check
that the extensive tests of the language that we have now have give
correct results with your new program and format.