On 18/09/2009 14:51, rgheck wrote:
On 09/18/2009 07:12 AM, Abdelrazak Younes wrote:
True, if the format changes the parser needs to change. However it is
quite configurable without changing any code, in part due to the
lyx-devel concerns about maintainability -- well, it paid off. For
example in the great Inset transition around 1.6.0, when
\begin_inset LatexCommand bibtex:BibTeX
became
\begin_inset CommandInset bibtex:BibTeX
(maybe it's the opposite, cannot really remember). You know how many
lines of code had to be changed? None at all, just add one line to the
configuration file. Plus, the old format still works. eLyXer can parse
any arbitrary combination of old and new commands, and it doesn't use
the version number at the top. To me that is added value in the form
of flexibility.
Sure it does but it seems dangerous too. Why not (if this is not
already the case) go the extra step and record in your config file
that 'LatexCommand' is 1.5 and 'CommandInset' is 1.6. This way eLyXer
could be useful for other purpose than just html; this way it could
possibly gives some code to lyx2lyx. eLyXer seems to gather a lot of
knowledge about lyx format, past and future, so at this point, a
deeper integration with LyX seems desirable, maybe even a merge with
lyx2lyx...
I don't myself see any value to "merging" elyxer with lyx2lyx. They do
totally different jobs. And both are simple filters. Neither really
knows anything about file format, in a sense: They just run through
the file, line by line, occasionally seeing things that they
recognize, and transforming them. That's about all they have in common.
If one or the other did form some kind of in-memory representation of
the document (e.g, DOM), then they'd have something to share. But
neither does.
Well, tex2lyx has no in-memory representation of the document and it
still shares some source code with LyX... I am just saying that there
certainly is some good things to reuse from eLyXer and that would be a
good way for Alex to be more "involved" in LyX. This guy surely knows
python and surely knows the lyx format very well so I'd be personally
happy if he joins more "formally" the developer crowd instead of
maintaining a one man project outside of LyX. Ultimately an option in
lyx2lyx to produce HTML would be very good and would make sense IMHO.
Abdel.