lyx-devel  

eLyXer: LyX to HTML converter

Alex Fernandez
Sun, 08 Mar 2009 14:42:23 -0700

Dear LyX developers:

First of all, thanks for making such a wonderful editor. LyX must be
the premier choice for authors that want LaTeX accuracy but using a
graphical tool; it is great for technical and mathematical texts.

There is however a point where the results are not as good as might be
expected: exporting to HTML. There are several projects in Debian that
seem to do the trick: LaTeX2HTML, Hevea and tth. (Tth is mentioned in
the LyX FAQ.) However, all of them tackle the broad problem of
converting from TeX to HTML; and none of them produce good output for
my particular needs. Formulae and images were just not right with any
of them.

So I embarked in the task of building a lyx-to-html converter, which I
called eLyXer. I am aware that the web is littered with such projects,
and this shows both:
 - that the problem is hard
 - and that there is a real need for a good solution.

My early results were encouraging: the relatively sparse set of LyX
commands, and specially the even smaller set that I use, have yielded
good results. And thanks to the excellent "Math in HTML with CSS":
 http://www.zipcon.net/~swhite/docs/math/math.html
I was also able to produce acceptable HTML for formulae, a
particularly sore point. A sample is online at:
 http://vecinos-productions.com/rayleigh/book.html

Maybe the program is useful to others, so now I am faced with the
problem of publishing the code. Should I just dump it on the web, and
let people find it and maybe use it; or is it of interest to the
larger LyX community, perhaps as an embedded converter or a side
project? Or maybe everyone is happy with existing tools, or is even
building their own more efficient custom converter?

The code is not apt for general public consumption right now: I am
transitioning from a monolithic program to a flexible pipe-based
converter, following the approach of Kernighan & Plauger's "Software
Tools". As it is it converts about 200 pages in 20 seconds on my Asus
Eee 1st generation (@700MHz) -- the example posted took 6s. Afterwards
another tool will segment the HTML file into navigable pages as
desired, and maybe add other bells and whistles (already present in
the monolithic version); the tools will be extensible for other LyX
commands. As to the code, it is a few thousand lines of Python in a
git repository, which I can also share if desired; the license I am
thinking of is the GPLv3.

Let me know what you think.

Thanks again,

Alex Fernández.