Example 2.3: Creation of module help
Generating help of a macro module is part of the video about macro modules from Example 2: Creation of global macro modules
Introduction
In this chapter, you will learn how to create a help page and an example network. For hands-on training, we will use the macro module Filter
, which was created in the previous chapter.
Depending on the way the macro module was created the default help page and example network might or might not exist. In case they exist, the help page only contains information about module in- and outputs as well as module fields. The example network only contains the macro module itself. Both, the help page and the example network, can be created and edited after module creation.
Steps to do
Creation of help files using MeVisLab MATE
We will start by creating a help file using the build in text editor MeVisLab MATE (MeVisLab Advanced Text Editor). If you open the context menu of your global macro module and select [ Help ], it might be, that no help page is given. We will start to create a help file by selecting [ Help → Create Help ]. If a help page already exists, select [ Help → Edit Help ].
MeVisLab MATE
opens. An *.mhelp file (Filter.mhelp) is created automatically and is stored in the folder your macro module Filter
is stored in. You can find the folder structure in MATE on the left side. Editing the text field, you can edit the help file.
When creating the help file of a module, all important information of the module down to the field specifications are extracted and created automatically. Thus, the basic module information is always available in the module help. Additional documentation should be added by the module author. On the left side, you can find the outline of the help file. Each section can be edited. In this example, we added the purpose of the module to the help file.
MATE offers the possibility to format the text. By using the button M, module names can be formatted in such a way that links to the respective help file of the modules are created.
After finishing your documentation, you can click Generate Help or F7 and your final help file is generated.
The result can be seen when opening the help file via context menu in MeVisLab IDE (or by pressing F1 ).
Creation of an example network
To add an example network to your module, you need to add a reference to the respective *.mlab file to the module definition file (.def). Open the file Filter.def. You can find the line exampleNetwork = “$(LOCAL)/networks/FilterExample.mlab”, which defines the reference to the *.mlab file containing the example network. Per default the name of the example network is ModulenameExample.mlab. An *.mlab file containing only the module Filter is created insight the folder networks.
It is possible that the reference to the example network or the file FilterExample.mlab is missing. One reason could be, that its creation was not selected when creating the macro module. In this case, add the reference and the file manually.
To create the example network, open the file FilterExample.mlab in MeVisLab and create an appropriate example.
Summary
- MeVisLab MATE is a build-in text editor which can be used to create module help files, module panels or to create module interactionss via Python scripting.
- You can create help files via the module context menu using MeVisLab Mate.
- You can add an example network to your macro module via the .def file