- Preparing to build an extension
- Building the extension
- Creating a Git repository
- Distributing the extension
- Updating the extension
This page describes the steps required to convert an existing tool into an extension.
If you know in advance that you want to build an extension, you can develop your tool from the beginning as one. Have a look at the Boilerplate Extension for a template.
Preparing to build an extension
Organizing files and folders
In order to build an extension you’ll first need to organize your files according to the Extension Folder Structure – separating code, documentation and resources:
- code folder required
- This is where the actual extension code goes. It may contain multiple subfolders.
- documentation folder optional
- Contains the documentation in html format. It must include an
- resources folder optional
- Contains additional files used by the extension, such as images, compiled tools, etc.
Documentation files can also be provided in markdown format – they are converted to html when the extension is built, and a default stylesheet is applied. An
index.md file is required.
Preparing extension metadata
Every extension must also include a metadata file with information such as:
- extension name required
- developer credits required
- version number required
- license optional
This information is added when building the extension.
Preparing metadata for Mechanic 2
If you wish to make your extension available to all RoboFont users, you’ll also need to provide additional data for Mechanic 2:
- extension repository required
- tags required
- icon optional
This information must be added to the Mechanic 2 server after the extension is built.
Building the extension
When all the data is ready and it’s time to build the extension, there are two options:
After you build the extension, you will have two versions of the code: the ‘unpackaged’ source, and the built extension package. You will need to make a decision about your workflow:
Continue treating the ‘unpackaged’ code as the source, and the extension as ‘compiled code’ for distribution.
Retire the ‘unpackaged’ code, and treat the extension as the (only) source code from now on.
Creating a Git repository
If you haven’t done so yet, now is a good time to create a Git repository to manage the changes in your code over time. You can choose between a public repository (for free & open-source extensions) or a private one (for custom or commercial extensions).
Distributing the extension
Extensions can be distributed to other RoboFont users using Mechanic.
The Mechanic extension allows users to install and manage public and private extensions, and to get updates once they become available.
- Open-source extensions
- can be added to the Mechanic server, so they are listed on the Mechanic website and in the Mechanic extensions index.
- Custom extensions
- can be distributed using
.mechanicfiles or private extension streams.
Updating the extension
As others start using your extension, you may receive bug reports, feature requests, comments etc. If your extension is open-source, you may get bug fixes directly as code. Use the tools provided by your Git platform of choice to manage the development process using issues, merge requests, branches etc.
You can commit changes to your repository at any time during the process.
In order for Mechanic to show an ‘update available’ notification to the users of your extension, it is necessary to increase the extension’s version number.