How to create an add-on for Antidoc
| The LabVIEW Toolkit Manual is probably the best project to glance at to see how to implement an add-on for Antidoc . |
Development environment
Install the Antidoc package for the LabVIEW version you are targeting.
| To let the Antidoc tool know about your add-on, you must set the Add-on source folder in the Advanced settings file. |
| When you work on the source of your add-on, you must uninstall any existing version of the add-on to be able to execute the add-on with the Antidoc tool |
Steps to create the add-on project
-
Create and save a blank project
-
Add a library to the project
-
Add a class to the library
-
Make this class inherit from
Document Type
-
Add a class to the library
-
Make this class inherit from
Config
|
To change the inheritance, the parent class must be in memory. Load the
|
-
Override the required functions.
Interface call order in Antidoc
To understand how to override functions, you need to understand how Antidoc is going to call the add-on code.
The following picture shows the call sequence (/labview-doc-generator/Sources/Tool/Generate Project Documentation.vi).
| 1 | Open the select add-on dialog |
| 2 | Update the config object |
| 3 | Check if the add-on configuration is valid - SHOULD BE OVERRIDE |
| 4 | Init the document creation - SHOULD BE OVERRIDE |
| 5 | Parse the source of the documentation - MUST BE OVERRIDE |
| 6 | Compose the final document - MUST BE OVERRIDE |
| 7 | Release anything used during the documentation creation - SHOULD BE OVERRIDE |
| 8 | Define the general documentation information - SHOULD BE OVERRIDE |
| 9 | Save the configuration on the disk to load it the next time the Antidoc UI is open |
Purpose of Override Functions in Antidoc
The classes in the Blocs folder of the add-on project represent the sections of the document, and each of these inherits from Antidoc’s bloc class.
-
Render.vi(override VI) in each bloc class should put content into the blocs, formatted using AsciiDoctor functions
Additionally
-
Parse.viin<add-on name>.lvclassis where the information for the content is read in (e.g. from LabVIEW/ TestStand file ref) -
Compose.viis for adding blocs into sections and organizing the different sections