LyX and markdown / pandoc

Pavel Sanda sanda at lyx.org
Sun Feb 14 21:03:43 UTC 2021


On Sat, Feb 13, 2021 at 08:58:40PM +0100, Thibaut Cuvelier wrote:
> Projects like
> https://github.com/nicowilliams/lyx2rfc/blob/master/src/lyx2xml.py are, in
> my opinion, doomed to fail in the long run. It is really easier to write
> code to work with LyX documents that directly within LyX, but the second
> option gives more confidence in having the conversion work reliably in the
> long term.

This is not just your opinion. There were more attempts in LyX history
trying for direct conversion .lyx -> html/xml.

All failed in long term and even if we used xml internally for .lyx format they
would likely still fail. Each major lyx version has incompatible changes, you
can't keep up with updating this forever.

We tried hard to explain this last time when independent volunteer tried
lyx->html route, but did not succeed. His results were shiny but after the
decade the tool is unusable and the effort was waste of energy.

So the only long term working solution is really to write exporting routines
*within* LyX framework like we have for tex, xhtml, docbook and ascii. In such
case when some new feature is created it's the lyx developers themselves who
will try to make the output routine for e.g.  xhtml work, not the third party.
Plus the export routines remain inert to format changes irrelevant to new
features etc.

One possible workaround might be to use current export formats to get pandoc
representation, that will be in some way more robust than relying on .lyx
format itself, but I have no clue whether having e.g. docbook could be of any
help here...

> Regarding the XML conversion of the LyX file format, you can also see
> places where it's planned for 3.0, but it's not really alive right now (at
> least, not that I know).

Correct, not alive now.

Pavel


More information about the lyx-devel mailing list