Re: building/packaging a lyx module

2013-11-21 Thread Richard Heck

On 11/21/2013 02:25 AM, Christoph Burschka wrote:

[sorry, accidentally replied directly instead of to the list]

On 11/21/2013 03:32 AM, Richard Heck wrote:

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


Ah, okay. I guess I was hoping for some kind of mini-settings file that
would only add or modify those specific lines when dropped into a
folder. Another thing some extendable programs use is a scripting API
(eg Gimp uses Python, VLC has Lua, etc.), which might then provide
commands like lyx.config.converters.add(from, to, command, options) to
let plugins mess around with settings while wrapping the internal logic.


Actually, this MIGHT be possible using the lyxserver interface, though 
LyX has to be running for that to work. The syntax would be something like:

lyxrc-apply \converter from to command to run converter flags
I.e., what follows is the converter line you wish to add.

Note that you would then have to save the preferences, as well, since 
that does not happen automatically:

preferences-save
Not sure how much this helps, though, since the user has to have set up 
the lyxpipes for the server to work. Typically, this is not done by default.


Totally not tested.

Richard



Re: building/packaging a lyx module

2013-11-21 Thread Liviu Andronic
On Thu, Nov 21, 2013 at 4:47 PM, Richard Heck rgh...@lyx.org wrote:
 Ah, okay. I guess I was hoping for some kind of mini-settings file that
 would only add or modify those specific lines when dropped into a
 folder. Another thing some extendable programs use is a scripting API
 (eg Gimp uses Python, VLC has Lua, etc.), which might then provide
 commands like lyx.config.converters.add(from, to, command, options) to
 let plugins mess around with settings while wrapping the internal logic.


 Actually, this MIGHT be possible using the lyxserver interface, though LyX
 has to be running for that to work. The syntax would be something like:
 lyxrc-apply \converter from to command to run converter flags
 I.e., what follows is the converter line you wish to add.


Hmm, how difficult would it be to have a CLI to this?

The reason I ask is that I've stumbled upon several instances where
adding a converter was proving a hindrance for users to try out a 3rd
party tool (and resulted in much prose and unnecessary screenshots
explaining how to manually add additional file types and converters to
LyX!). I can think of Andrew's pLyX (
http://wiki.lyx.org/Examples/PLyXSystem ) and Rob's  word2lyx (
http://blog.oak-tree.us/index.php/2012/03/08/word2lyx01-2 ). Providing
users with a 'lyx --add-converter [..]' command would be so much
neater.

Regards,
Liviu


 Note that you would then have to save the preferences, as well, since that
 does not happen automatically:
 preferences-save
 Not sure how much this helps, though, since the user has to have set up the
 lyxpipes for the server to work. Typically, this is not done by default.

 Totally not tested.

 Richard




-- 
Do you know how to read?
http://www.alienetworks.com/srtest.cfm
http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader
Do you know how to write?
http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail


Re: building/packaging a lyx module

2013-11-21 Thread Richard Heck

On 11/21/2013 02:25 AM, Christoph Burschka wrote:

[sorry, accidentally replied directly instead of to the list]

On 11/21/2013 03:32 AM, Richard Heck wrote:

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


Ah, okay. I guess I was hoping for some kind of mini-settings file that
would only add or modify those specific lines when dropped into a
folder. Another thing some extendable programs use is a scripting API
(eg Gimp uses Python, VLC has Lua, etc.), which might then provide
commands like lyx.config.converters.add(from, to, command, options) to
let plugins mess around with settings while wrapping the internal logic.


Actually, this MIGHT be possible using the lyxserver interface, though 
LyX has to be running for that to work. The syntax would be something like:

lyxrc-apply \converter from to command to run converter flags
I.e., what follows is the converter line you wish to add.

Note that you would then have to save the preferences, as well, since 
that does not happen automatically:

preferences-save
Not sure how much this helps, though, since the user has to have set up 
the lyxpipes for the server to work. Typically, this is not done by default.


Totally not tested.

Richard



Re: building/packaging a lyx module

2013-11-21 Thread Liviu Andronic
On Thu, Nov 21, 2013 at 4:47 PM, Richard Heck rgh...@lyx.org wrote:
 Ah, okay. I guess I was hoping for some kind of mini-settings file that
 would only add or modify those specific lines when dropped into a
 folder. Another thing some extendable programs use is a scripting API
 (eg Gimp uses Python, VLC has Lua, etc.), which might then provide
 commands like lyx.config.converters.add(from, to, command, options) to
 let plugins mess around with settings while wrapping the internal logic.


 Actually, this MIGHT be possible using the lyxserver interface, though LyX
 has to be running for that to work. The syntax would be something like:
 lyxrc-apply \converter from to command to run converter flags
 I.e., what follows is the converter line you wish to add.


Hmm, how difficult would it be to have a CLI to this?

The reason I ask is that I've stumbled upon several instances where
adding a converter was proving a hindrance for users to try out a 3rd
party tool (and resulted in much prose and unnecessary screenshots
explaining how to manually add additional file types and converters to
LyX!). I can think of Andrew's pLyX (
http://wiki.lyx.org/Examples/PLyXSystem ) and Rob's  word2lyx (
http://blog.oak-tree.us/index.php/2012/03/08/word2lyx01-2 ). Providing
users with a 'lyx --add-converter [..]' command would be so much
neater.

Regards,
Liviu


 Note that you would then have to save the preferences, as well, since that
 does not happen automatically:
 preferences-save
 Not sure how much this helps, though, since the user has to have set up the
 lyxpipes for the server to work. Typically, this is not done by default.

 Totally not tested.

 Richard




-- 
Do you know how to read?
http://www.alienetworks.com/srtest.cfm
http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader
Do you know how to write?
http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail


Re: building/packaging a lyx module

2013-11-21 Thread Richard Heck

On 11/21/2013 02:25 AM, Christoph Burschka wrote:

[sorry, accidentally replied directly instead of to the list]

On 11/21/2013 03:32 AM, Richard Heck wrote:

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


Ah, okay. I guess I was hoping for some kind of mini-settings file that
would only add or modify those specific lines when dropped into a
folder. Another thing some extendable programs use is a scripting API
(eg Gimp uses Python, VLC has Lua, etc.), which might then provide
commands like "lyx.config.converters.add(from, to, command, options)" to
let plugins mess around with settings while wrapping the internal logic.


Actually, this MIGHT be possible using the lyxserver interface, though 
LyX has to be running for that to work. The syntax would be something like:

lyxrc-apply \converter from to "command to run" "converter flags"
I.e., what follows is the converter line you wish to add.

Note that you would then have to save the preferences, as well, since 
that does not happen automatically:

preferences-save
Not sure how much this helps, though, since the user has to have set up 
the lyxpipes for the server to work. Typically, this is not done by default.


Totally not tested.

Richard



Re: building/packaging a lyx module

2013-11-21 Thread Liviu Andronic
On Thu, Nov 21, 2013 at 4:47 PM, Richard Heck  wrote:
>> Ah, okay. I guess I was hoping for some kind of mini-settings file that
>> would only add or modify those specific lines when dropped into a
>> folder. Another thing some extendable programs use is a scripting API
>> (eg Gimp uses Python, VLC has Lua, etc.), which might then provide
>> commands like "lyx.config.converters.add(from, to, command, options)" to
>> let plugins mess around with settings while wrapping the internal logic.
>
>
> Actually, this MIGHT be possible using the lyxserver interface, though LyX
> has to be running for that to work. The syntax would be something like:
> lyxrc-apply \converter from to "command to run" "converter flags"
> I.e., what follows is the converter line you wish to add.
>

Hmm, how difficult would it be to have a CLI to this?

The reason I ask is that I've stumbled upon several instances where
adding a converter was proving a hindrance for users to try out a 3rd
party tool (and resulted in much prose and unnecessary screenshots
explaining how to manually add additional file types and converters to
LyX!). I can think of Andrew's pLyX (
http://wiki.lyx.org/Examples/PLyXSystem ) and Rob's  word2lyx (
http://blog.oak-tree.us/index.php/2012/03/08/word2lyx01-2 ). Providing
users with a 'lyx --add-converter [..]' command would be so much
neater.

Regards,
Liviu


> Note that you would then have to save the preferences, as well, since that
> does not happen automatically:
> preferences-save
> Not sure how much this helps, though, since the user has to have set up the
> lyxpipes for the server to work. Typically, this is not done by default.
>
> Totally not tested.
>
> Richard
>



-- 
Do you know how to read?
http://www.alienetworks.com/srtest.cfm
http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader
Do you know how to write?
http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail


Re: building/packaging a lyx module

2013-11-20 Thread Richard Heck

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



Re: building/packaging a lyx module

2013-11-20 Thread Christoph Burschka
[sorry, accidentally replied directly instead of to the list]

On 11/21/2013 03:32 AM, Richard Heck wrote:
 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
 

Ah, okay. I guess I was hoping for some kind of mini-settings file that
would only add or modify those specific lines when dropped into a
folder. Another thing some extendable programs use is a scripting API
(eg Gimp uses Python, VLC has Lua, etc.), which might then provide
commands like lyx.config.converters.add(from, to, command, options) to
let plugins mess around with settings while wrapping the internal logic.

Those might be cool features for some remote future version, though I
have no idea how much demand there would be to justify them.


Cheers,
Christoph



signature.asc
Description: OpenPGP digital signature


Re: building/packaging a lyx module

2013-11-20 Thread Richard Heck

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



Re: building/packaging a lyx module

2013-11-20 Thread Christoph Burschka
[sorry, accidentally replied directly instead of to the list]

On 11/21/2013 03:32 AM, Richard Heck wrote:
 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
 

Ah, okay. I guess I was hoping for some kind of mini-settings file that
would only add or modify those specific lines when dropped into a
folder. Another thing some extendable programs use is a scripting API
(eg Gimp uses Python, VLC has Lua, etc.), which might then provide
commands like lyx.config.converters.add(from, to, command, options) to
let plugins mess around with settings while wrapping the internal logic.

Those might be cool features for some remote future version, though I
have no idea how much demand there would be to justify them.


Cheers,
Christoph



signature.asc
Description: OpenPGP digital signature


Re: building/packaging a lyx module

2013-11-20 Thread Richard Heck

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



Re: building/packaging a lyx module

2013-11-20 Thread Christoph Burschka
[sorry, accidentally replied directly instead of to the list]

On 11/21/2013 03:32 AM, Richard Heck wrote:
> 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
> 

Ah, okay. I guess I was hoping for some kind of mini-settings file that
would only add or modify those specific lines when dropped into a
folder. Another thing some extendable programs use is a scripting API
(eg Gimp uses Python, VLC has Lua, etc.), which might then provide
commands like "lyx.config.converters.add(from, to, command, options)" to
let plugins mess around with settings while wrapping the internal logic.

Those might be cool features for some remote future version, though I
have no idea how much demand there would be to justify them.


Cheers,
Christoph



signature.asc
Description: OpenPGP digital signature