|
From: | address@hidden |
Subject: | Re: [eLyXer-users] Elyxer svg file conversion problems. |
Date: | Thu, 21 Jan 2010 22:29:06 -0500 |
User-agent: | Thunderbird 2.0.0.19 (X11/20081209) |
Elyxer needs to provide the following options: 1 - The option of passing the .svg file straight through, unaltered for reference from the html file. Though I would be unlikely to use this option for the same compatibility concerns.Bit ugly.2 - The option of specifying a custom conversion command for *.svg My Inkscape command would be something like: inkscape *.svg --export-png=*.pngWould a --inkscape option serve you? It should not be difficult to add.3 - The option of specifying a custom conversion command for specific .svg files because some of my .svg files are converted with this command: inkscape *.svg --export-png=*.png --export-area=-44:16:-28:32 The workaround is to pre-convert the .svg files to .png and then reference the .png files in the .lyx This eliminates the problem of how to trick Lyx into showing a proper preview.But it looks quite cumbersome.
I suggest a --conv <file-name> elyxer option with which we can provide a file of conversion rules. For each file to be converted elyxer searches the file from the top down and use the first conversion rule that matches. Here is an example:fig1.svg fig2.svg : inkscape %f --export-png=%b.png --export-area=-44:16:-28:32
*.svg : inkscape %f --export-png=%b.png *.xfig : xfig %f %b.png * : convert %f %b.png In this example, a file named fig1.svg (or fig2.svg) would match the first rule. All other .svg files would match the second rule. All .xfig files would match the third rule and all other files would match the last rule. elyxer compares the file name to be converted with the patterns before the ':' If there is a match it uses the command which is provided after the ':' and replaces embedded patterns with parts of the file name. %f is replaced by the whole file name. %b is replaced by the base part (drop the suffix) etc. This could probably be implemented with very little python code. You could ship elyxer with a default conversion rule file. If you need a clear indication of the name of the destination file so that you can check for existence and time stamps you could do this: *.svg : %b.png : inkscape %f --export-png=%o Fields: #1 : File to convert. #2 : The output file ( %o ). #3 : The conversion command. This is a rough suggestion, but I think you get the idea. Bill
[Prev in Thread] | Current Thread | [Next in Thread] |