Metadata
This section contains the metadata properties for the component, such as the component name and who created it.
The following informational metadata properties can be set:
- name - the name of your component (required)
- author - name of the author of the component (required, recommended to be your GitHub username)
- guid - the unique identifier for your component
- This must be unique - make sure you don't use a GUID from an existing component
- additionalinformation - any extra information by the author, e.g. a link to their website
Additionally, the following properties affect the behaviour of the component:
- minsize - the minimum size for your component (assumed to be equal to the grid size if omitted)
- canresize - whether your component has a fixed size or can be resized by the user (default: true if omitted)
When using GitPod or Linux, you can create a new GUID by running this in the terminal:
$ cat /proc/sys/kernel/random/uuid
On Windows, the following PowerShell command creates a GUID:
> [guid]::NewGuid()
Each piece of metadata is made up of a single <meta>
tag, inside the <declaration>
tag.
<meta name="(property)" value="(value)" />
Example
The following metadata is from the standard resistor component included with Circuit Diagram.
<!--?xml version="1.0" encoding="utf-8"?-->
<component version="1.2"
xmlns="http://schemas.circuit-diagram.org/circuitDiagramDocument/2012/component/xml">
<declaration>
<meta name="name" value="Resistor" />
<meta name="guid" value="dab6d52b-51a0-49b0-bc40-3cda966148aa" />
<meta name="minsize" value="50" />
<meta name="canresize" value="true" />
<meta name="canflip" value="true" />
...
</declaration>
...
</component>