Helipad add-on documentation

h2. FAQ

Q: How to I make a plugin?

* Create a Helipad document with the XML layout shown below
* Tag your document with system:theme or system:plugin
* To allow other users to access it, enable sharing

Q: What happens when I install a plugin?

A: The system copies the document to your account.

Q: What happens when someone deletes a plugin?

A: Nothing; you should still be able to use it if you installed it.  Installing a plugin creates a copy that they can upgrade.  Use versions and a changelog to let them know when a plugin has been updated.

Q: How are upgrades handled?

A: Helipad checks the installed version against the original plugin and replaces the content.

Q: What pages are plugins executed on?

A: The dashboard, tag search, document edit and document preview pages.

h2. XML format for themes

Title and tags are derived from the document.

<div style="white-space: pre; margin: 0; border: 2px solid #999; background-color: #ffc">
&lt;theme&gt;
  &lt;description&gt;What is this theme?&lt;/description&gt;
  &lt;image&gt;<code>http://example.com/your_image.jpg</code>&lt;/image&gt;
  &lt;code&gt;&lt;![CDATA[
    /* CSS GOES HERE */
  ]]&gt;
  &lt;/code&gt;
&lt;/theme&gt;<br/>
</div>
<br/>

h2. XML format for plugins

Title and tags are derived from the document.  Use a tag called "code" to contain your JavaScript, and one called "style" to contain any CSS your plugin requires.

<div style="white-space: pre; margin: 0; border: 2px solid #999; background-color: #ffc">
&lt;plugin&gt;
  &lt;description&gt;This is an example plugin.&lt;/description&gt;
  &lt;image&gt;&lt;/image&gt;
  &lt;version&gt;1&lt;/version&gt;
  &lt;changelog&gt;
    &lt;change&gt;
      &lt;version&gt;1&lt;/version&gt;
      &lt;description&gt;Created this plugin&lt;/description&gt;
    &lt;/change&gt;
  &lt;/changelog&gt;
  &lt;style&gt;
.my_plugin_style { color: #990000; }
  &lt;/style&gt;
  &lt;code&gt;&lt;![CDATA[
var ExamplePlugin = Class.create()
ExamplePlugin.prototype = {
  initialize: function()
  {
  },
}
plugin_manager.register(ExamplePlugin, {dependsOn: ''})
]]&gt;&lt;/code&gt;
&lt;/plugin&gt;

</div>

Set <code>dependsOn</code> to a page element your plugin depends on.  For example, I used "document_source" to make sure the word count plugin only runs on the document edit/create pages.


