Difference between revisions of "INX extension descriptor format"

From Inkscape Wiki
Jump to navigation Jump to search
m (MakingAnExtension moved to MakingAnINX: the old page was duplicating information. I'm rolling that information into ScriptingHOWTO and moving all INX information here to be fleshed out.)
Line 1: Line 1:
How an extension must work and how to write an INX file.
== Intorduction ==


== About the Inkscape Extension Interface ==
In order for Inkscape to make use of an external script or program, you must describe that script to inkscape using an INX file. See the inkscape share directory for examples. The INX file allows the author to:
* label strings for translation
* define parameters
* chain extensions
* etc


The inkscape call a program with some arguments and as the last argumet it tells to the extension program where is the temporay SVG file to do the work. The temporay SVG file represents the actual state of the working SVG.
=== Localisation of extensions ===


After the extension program work it writes the modified SVG to the default output, the Inkscape get this and update the SVG for the user.
To allow localisation of strings in extension for Inkscape, some xml tags have to be adapted to variant readable by intltool. It means that tags or parametres has to have "_" prepended to their name, e.g. <_name>name of extension</_name>


== How to Write an INX File ==
Also the path to the extension has to be included in POTFILES.in file to tell intltool where to look for translatable content.
 
Usefull information, before this section gets fully updated, can be found at [http://gould.cx/ted/blog/Translating_Custom_XML Ted's blog].
 
== Example ==
More example INX files are available in the Inkscape distribution or in the Inkscape [http://inkscape.svn.sourceforge.net/viewvc/inkscape/inkscape/trunk/share/extensions/|SVN repository].


'''Example:'''
   <inkscape-extension>
   <inkscape-extension>
     <_name>{Friendly Extension Name}</_name>
     <_name>{Friendly Extension Name}</_name>

Revision as of 16:58, 16 November 2006

Intorduction

In order for Inkscape to make use of an external script or program, you must describe that script to inkscape using an INX file. See the inkscape share directory for examples. The INX file allows the author to:

  • label strings for translation
  • define parameters
  • chain extensions
  • etc

Localisation of extensions

To allow localisation of strings in extension for Inkscape, some xml tags have to be adapted to variant readable by intltool. It means that tags or parametres has to have "_" prepended to their name, e.g. <_name>name of extension</_name>

Also the path to the extension has to be included in POTFILES.in file to tell intltool where to look for translatable content.

Usefull information, before this section gets fully updated, can be found at Ted's blog.

Example

More example INX files are available in the Inkscape distribution or in the Inkscape repository.

 <inkscape-extension>
   <_name>{Friendly Extension Name}</_name>
   <id>{org.domain.sub-domain.extension-name}</id>
     <dependency type="executable"
                 location="[extensions|{location}]">program.ext</dependency>
     <param name="{argumentName}" type="[int|float|string]"
            min="{number}" max="{number}"
            _gui-text="{Friendly Argument Name}">{default value}</param>
   <effect>
     <object-type>[all|{element type}]</object-type>
       <effects-menu>
         <submenu _name="{Extension Group Name}"/>
       </effects-menu>
   </effect>
   <script>
     <command reldir="extensions"
              interpreter="[python|perl|bash|{some other}]">program.ext</command>
   </script>
 </inkscape-extension>

See Also

ScriptingHOWTO