Exhibit/Implementing Exporters

From SIMILE Widgets
Jump to: navigation, search

The basic process for creating an exporter is:

  1. Create a javascript file under api/scripts/exporters/ with a name like my-format-exporter.js. It's probably a good idea to start off by duplicating one of the pre-existing exporters.
  2. Assuming you've started from one of the other exporters, say exhibit-json-exporter.js, replace all instances of the current exporter name and replace it with your new name in CamelCase. For this example, all instances of "ExhibitJsonExporter" would be replaced with "MyFormatExporter" in the file.
  3. Notice the getLabel function. You'll want to replace this label with one more appropriate for your exporter. Pick a label that you'll want Exhibit to use to refer to the exporter (say, "myFormatExporterLabel"). Replace the old with the new.
  4. Implement.  ;)
  5. Now you need to let Exhibit know that your new exporter exists. In api/scripts/exhibit.js you'll find an array of exporters defined in Exhibit._Impl. Add your exporter to the array. As earlier, you'll want to refer to your exporter by CamelCase(e.g. Exhibit.MyFormatExporter).
  6. Finally, you'll want to add your label from step 3 to the localizations. As of this writing, there is only one localization: English. Go to api/locales/en/scripts and edit exhibit-l10n.js to reflect your label.

Note that these are just a few early stage notes -- this needs to be fleshed out and potentially corrected!

Personal tools