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

Steps to create the add-on project

  1. Create and save a blank project

blanc project
  1. Add a library to the project

document type lvlib
  1. Add a class to the library

document type class
  1. Make this class inherit from Document Type

document type inheritance
  1. Add a class to the library

config class
  1. Make this class inherit from Config

config inheritance

To change the inheritance the parent class must be in memory. Load the Config.lvclass and Document Type.lvclass dropping a VI from the Antidoc functions palette to a VI diagram.

load classes in memory
  1. Override the required functions

document type override 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).

calling order in antidoc
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 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.vi in <add-on name>.lvclass is where the information for the content is read in (e.g. from LabVIEW/ TestStand file ref)

  • Compose.vi is for adding blocs into sections and organising the different sections