开发者

Doxygen equivalent for Mathematica?

开发者 https://www.devze.com 2022-12-29 06:26 出处:网络
How do you put additional information into a Mathematica package file, like parameter specification doctests/example usage?

How do you put additional information into a Mathematica package file, like

  • parameter specification
  • doctests/example usage?

Up to now, I only found the ::usage string an开发者_JAVA技巧d some information on how to write documentation notebooks. I am looking for an option to generate these documentation notebooks from introspecting package files.


I don't know that there is any mechanism such as doxygen built into mathematica. If you want to embed a documentation notebook into your package I would proceed as follows

  1. Write up the documentation notebook
  2. Embed the notebook as a character string in your package
  3. Write a help function that, when called, crates a file, writes out the notebook and uses front end manipulations to open it

You might be able to skip the creation of the external notebook by using Notebook[] instead of a character string for storing the documentation notebook inside your package file.

Integrating with Mathematica's own Help system is a bit more difficult (as the link you gave explains). Of course, you could still have the package write and move the appropriate files into place when the package loads.

0

精彩评论

暂无评论...
验证码 换一张
取 消