The previous article about IDLdoc showed how to get and run IDLdoc on your library without changing any of your code. Now, what if you are willing to add special tags to your comments for IDLdoc’s use?

So here is just the header of the MG_N_SMALLEST routine with a few of the most common tags in the comments:

; Finds the n smallest elements of a data array. This algorithm works
; fastest on uniformly distributed data. The worst case for it is a 
; single smallest data element and all other elements with another 
; value. This will be nearly equivalent to just sorting all the 
; elements and choosing the first n elements.
; @returns index array
; @param data {in}{required}{type=numeric array} data array of any
;        numeric type (except complex/dcomplex)
; @param n {in}{required}{type=integer} number of smallest elements 
;        to find
; @keyword largest {in}{optional}{type=boolean} set to find n largest 
;          elements
function mg_n_smallest, data, n, largest=largest

These comments produce this output.

There are other tags to document authors, history of the code, copyright, assumptions, category the code addresses, etc. For a complete list of the tags allowed in IDLdoc 2.0, see the developer’s help page (produced by IDLdoc when it runs and also included in the distribution of IDLdoc in the “docs” directory).

Next, I’ll talk about customizing the overview pages and then on to some of the more advanced features.