I'm looking for a way to document the functions of my packages inline, preferably inside comments. There should be a Doxygen type tool for this that takes comments and that generates html from markup like this:

    @function   myFib[n] gives the nth fibonacci number
    @options    none
    @param      n is an integer
    @example    'Here is a plot of myFib @(ListPlot[myFib /@ Range[100]])'
    @return     0 if successful; or 1 if failed

Question: Does anyone know if there a package for this? If there is no open source solution, are there any good link explaining how to write such a parser?

  • $\begingroup$ For each function or variable, e.g., f[x_]:= x^2; write your own message, such as f::usage = "f[x] gives x^2"; $\endgroup$ – David G. Stork Feb 3 '15 at 23:17
  • 1
    $\begingroup$ Thanks @DavidG.Stork. Yes I use usage:: all the time, but a single sentence is not what I'm looking for, I want the ability write a summary that spell out examples, to callout arguments and such things, and have all of this then in a website. Sounds like a tall order right? But it's a very common thing to have rich inline documentation generation in other languages... $\endgroup$ – M.R. Feb 3 '15 at 23:29
  • 1
    $\begingroup$ You can write as much as you like in your usage message (and I do), including examples. You might want to collect all usage messages and export them. $\endgroup$ – David G. Stork Feb 3 '15 at 23:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.