[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[eLyXer-users] eLyXer integration, round two

From: Alex Fernandez
Subject: [eLyXer-users] eLyXer integration, round two
Date: Mon, 14 Sep 2009 00:24:34 +0200

Hi folks,

Since eLyXer was offered to be integrated with LyX it has gone a long
way. The last version, 0.30, supports Python distutils -- this means
that the eLyXer library can be easily installed in the user's Python
libraries. This might help a lot for getting eLyXer integrated with
LyX without having to actually insert its code there. Also, having to
place the file elyxer.py in a specific directory within LyX is a
suboptimal solution, as some users and integrators have complained:
for every update you have to place elyxer.py into that folder again,
or you lose the integration.

So everything that is needed is a bridge that can be used to call the
local library. Attached is this file elyxerbridge.py, which should be
added to directory $s/scripts/; it simply gathers command line
parameters and calls elyxerconv with it. The detection method needs a
little change, which is commented below.

The enclosed code has the same license as LyX,and hereby I grant
permission for its integration within the LyX code base and for use in
the LyX project as it sees fit.

I still dislike the way LyX deals with formats, and haven't found the
time to play with Jürgen's new view options. But this new mechanism
can be integrated with them, I hope, without further changes -- after
all the lines I modified were not changed by Jürgen in this last
round. (I will learn if any changes are needed as soon as I finish
compiling latest from svn.) The enclosed patch should apply cleanly.

Let me know what you think,


--- start ---
    checkProg('an MS Word -> LaTeX converter', ['wvCleanLatex $$i $$o'],
        rc_entry = [ r'\converter word       latex      "%%"    ""' ])
    # eLyXer: search as a library (elyxerconv) and then as an
executable (elyxer.py, elyxer)
    elyxerfound = False
    print '+checking for "eLyXer Converter"... ',
      import elyxerconv
# if the library elyxerconv can be found then elyxerbridge is used
      addToRC(r'''\converter lyx      html
"$$s/scripts/elyxerbridge.py --directory $$r $$i $$o"  ""''')
      elyxerfound = True
      print ' yes'
    except ImportError:
      print ' no'
# traditional lookup for the executable elyxer.py or just elyxer
      path, elyxer = checkProg('a LyX -> HTML converter', ['elyxer.py
--directory $$r $$i $$o','elyxer --directory $$r $$i $$o'],
          rc_entry = [ r'\converter lyx      html       "%%"    ""' ])
      if elyxer.find('elyxer') >= 0:
        addToRC(r'''\copier    html       "python -tt
$$s/scripts/ext_copy.py -e html,png,jpg,jpeg,css $$i $$o"''')
        elyxerfound = True

    if not elyxerfound:
# now look for other HTML converters
      # On SuSE the scripts have a .sh suffix, and on debian they are
in /usr/share/tex4ht/
--- end ---

Attachment: elyxerbridge.diff
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]