Difference between revisions of "INX extension descriptor format"

From Inkscape Wiki
Jump to navigation Jump to search
(Add description for `implements-custom-gui` effect attribute)
(→‎Attributes description: add missing needs-document and needs-live-preview attributes)
Line 38: Line 38:
| <code>"true"</code> <nowiki>|</nowiki> <code>"false"</code> (default)
| <code>"true"</code> <nowiki>|</nowiki> <code>"false"</code> (default)
| If set to <code>true</code> '''requires''' effect extension to implement custom GUI. Implementation detail: "extension is working" window is not show for this kind of extensions.  
| If set to <code>true</code> '''requires''' effect extension to implement custom GUI. Implementation detail: "extension is working" window is not show for this kind of extensions.  
| <code>needs-document</code>
| <code>"true"</code> <nowiki>|</nowiki> <code>"false"</code> (default)
| '''''(please fill in!)'''''
| <code>needs-live-preview</code>
| <code>"true"</code> <nowiki>|</nowiki> <code>"false"</code> (default)
| '''''(please fill in!)'''''
== Example ==
== Example ==

Revision as of 21:02, 19 June 2019


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

Be sure to read through the INX files that come with Inkscape. Nothing beats a working example.

Translation of extensions

Extension dialog windows, described in INX files, can be prepared for translation or localisation by adding an _ (underscore) to the XML tags or attributes. Only add underscores when text need to be translated (not numeric values, for example!).


<_name>Some translatable extension name</_name>


<param name="..." type="..." _gui-text="Some translatable label text">

When extensions are included in the Inkscape BZR Repository, various scripts will scan each INX file for translatable text and prepare translation files for others to translate.

See also: Ted's blog.

Attributes description

Attribute name Allowed values Comment
implements-custom-gui (new in 1.0) "true" | "false" (default) If set to true requires effect extension to implement custom GUI. Implementation detail: "extension is working" window is not show for this kind of extensions.
needs-document "true" | "false" (default) (please fill in!)
needs-live-preview "true" | "false" (default) (please fill in!)


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

<?xml version="1.0" encoding="UTF-8"?>
<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension">
  <_name>{Friendly Extension Name}</_name>
  <dependency type="executable" location="[extensions|path|plugins|{location}]">program.ext</dependency>
  <param name="tab" type="notebook">  
    <page name="controls" _gui-text="Controls">
      <param name="{argumentName}" type="[int|float|string|boolean|description]" min="{number}" max="{number}"
        _gui-text="{Friendly Argument Name}">{default value}</param>
    <page name="help" _gui-text="Help">
      <param name="help_text" type="description">{Friendly Extension Help}</param>
    <object-type>[all|{element type}]</object-type>
        <submenu _name="{Extension Group Name}"/>
    <command reldir="extensions" interpreter="[python|perl|ruby|bash|{some other}]">program.ext</command>

For a full list of currently supported interpreters, please see Extension Interpreters.

DTD XML schema

The following XML schema may not fully describe the current ING file structure. The actual XML schema used is described in the next paragraph.

 <!ELEMENT inkscape-extension (name, id, dependency*, param*,(input|output|effect),(script|plugin))>
 <!ELEMENT input (extension, mimetype, filetype, filetypetooltip, output_extension?)>
 <!ELEMENT output (extension, mimetype, filetype, filetypetooltip, dataloss?)>
 <!ELEMENT effect (object-type|submenu?)>
 <!ELEMENT script (command, helper_extension*, check*)>
 <!ELEMENT plugin (name)>
 <!ELEMENT name (#PCDATA)>
 <!ELEMENT item (#PCDATA)>
 <!ELEMENT option (#PCDATA)>
 <!ELEMENT dependency (#PCDATA)>
 <!ELEMENT param (#PCDATA|page|item|option)*>
 <!ELEMENT page (#PCDATA, param*)>
 <!ELEMENT extension (#PCDATA)>
 <!ELEMENT mimetype (#PCDATA)>
 <!ELEMENT filetype (#PCDATA)>
 <!ELEMENT filetooltip (#PCDATA)>
 <!ELEMENT object-type (#PCDATA)>
 <!ELEMENT command (#PCDATA)>
 <!ELEMENT check (#PCDATA)>
 <!ELEMENT dataloss (#PCDATA)>
 <!ELEMENT helper_extension (#PCDATA)>
 <!ELEMENT output_extension (#PCDATA)>
 <!ATTLIST check reldir (absolute|path|extensions|plugins) #REQUIRED>
 <!ATTLIST command reldir (absolute|path|extensions|plugins) #REQUIRED>
 <!ATTLIST command interpreter CDATA #REQUIRED>
 <!ATTLIST dependency type (executable|extension) #REQUIRED>
 <!ATTLIST dependency location (absolute|path|extensions|plugins) #IMPLIED>
 <!ATTLIST dependency description CDATA #IMPLIED>
 <!ATTLIST effect needs-live-preview (true|false) #REQUIRED>
 <!ATTLIST effect implements-custom-gui (true|false) #IMPLIED>
 <!ATTLIST page gui-text CDATA #IMPLIED>
 <!ATTLIST param type (int|float|string|boolean|enum|notebook|description|optiongroup|color) #REQUIRED>
 <!ATTLIST param max_length CDATA #IMPLIED>
 <!ATTLIST param precision CDATA #IMPLIED>
 <!ATTLIST param gui-text CDATA #IMPLIED>
 <!ATTLIST param gui-tip CDATA #IMPLIED>
 <!ATTLIST param gui-description CDATA #IMPLIED>
 <!ATTLIST param scope CDATA #IMPLIED>
 <!ATTLIST param gui-hidden CDATA #IMPLIED>
 <!ATTLIST param appearance (minimal|) "">
 <!ATTLIST submenu name CDATA #REQUIRED>


The XML schema for ING files is available in the Inkscape BZR repository. This is a RELAX NG schema.

A compactly formatted version of the schema (created on 2 November 2010 using Trang):

default namespace =

start =
  element inkscape-extension {
    element _name { text },
    element id { text },
    element dependency {
      attribute type { inx.dependency-type.values },
      attribute location { inx.location.values }?,
      attribute _description { text }?,
     | element param {
         attribute name { text },
         attribute type { "notebook" },
         element page {
           attribute name { text },
           attribute _gui-text { text },
    (element input {
       element output_extension { text }?
     | element output {
         element dataloss { xsd:boolean }?
     | element effect {
         attribute needs-document { xsd:boolean }?,
         attribute needs-live-preview { xsd:boolean }?,
         element object-type {
           xsd:token "all" | xsd:token "path" | xsd:token "rect"
         element effects-menu {
           attribute hidden { xsd:boolean "true" }
           | element submenu {
               attribute _name { text },
     | element path-effect { empty }
     | element print { empty }),
    (element script {
       element command {
         attribute interpreter { "python" | "perl" }?,
       element helper_extension { xsd:NMTOKEN }?,
       element check { inx.reldir.attr, text }*
     | element xslt {
         element file { inx.reldir.attr, text }
     | element plugin {
         element name { text }
inx.reldir.attr = attribute reldir { inx.location.values }
inx.location.values = "extensions" | "path" | "plugins"
inx.dependency-type.values = "extension" | "executable" | "plugin"
inx.io.common =
  element extension { text },
  element mimetype { text },
  element _filetypename { text }?,
  element _filetypetooltip { text }?
inx.parameter =
  attribute name { xsd:token },
  attribute gui-hidden { xsd:boolean }?,
  attribute _gui-text { text }?,
  ((attribute type { "int" },
    attribute min { xsd:integer }?,
    attribute max { xsd:integer }?,
    (empty | xsd:integer))
   | (attribute type { "float" },
      attribute precision { xsd:integer }?,
      attribute min { xsd:float }?,
      attribute max { xsd:float }?,
   | (attribute type { "boolean" },
   | (attribute type { "string" },
      attribute max_length { xsd:integer }?,
      (empty | text))
   | (attribute type { "description" },
   | (attribute type { "enum" },
      (element _item { inx.parameter.enum.item }
       | element item { inx.parameter.enum.item })+)
   | (attribute type { "optiongroup" },
      attribute appearance { "minimal" }?,
      (element option { inx.parameter.optiongroup.option }
       | element _option { inx.parameter.optiongroup.option })+))
inx.parameters =
  element param { inx.parameter }
  | element _param { inx.parameter }
inx.parameter.enum.item =
  attribute value { text },
inx.parameter.optiongroup.option =
  attribute value { text }?,

See Also