On 11/20/2013 08:00 PM, Christoph Burschka wrote:
Hi,

I'm currently trying to write a lyx module (for my own use, though it
may end up on github eventually) that roughly imitates for Python what
knitr/sweave are doing with R:

- Provide an inset for noweb-like code blocks
- Run the file through a pre-processor to interpret those blocks
- Continue Latex compilation with the output inserted.

The first prototype seems to work, but it took quite a bit of
configuring. Adding the module was easy enough (putting the .module in
~/.lyx/layouts, the Python script in ~/.lyx/scripts), but I had to
manually add the file formats and converters to the settings; something
like
pyweave->latex : python3 $$s/scripts/python-weave.py $$i $$o

Is there any way to set up stuff like that automatically with an
installation script? Ideally, I'd want to package the module so I can
install it on other systems without manually configuring anything.

The only thing I can think of, as things now are, is to run some script (you can use python, since we know that should be installed) that would automatically add the relevant lines to the user's preferences file. Of course, then you have to find that file, and I'm not sure if there's a totally portable way to do it. Many users wouldn't even be able to find it themselves. But you could at least check the standard locations.

Richard

Reply via email to