Websites Navigation: Airbit | Shop | m-shell.net
Languages: EN | DE

Module mdoc

m documentation generator, inspired from javadoc. It scans m scripts and modules for classes, functions, constants and variables and outputs a summary of the items found. The current implementation produces linked HTML output. The DocGenerator class can be subclassed to produce other formats.

Sample usage:

  generator:mdoc.DocGenerator=mdoc.DocGenerator()
  for f in files do
    generator.addSource(f)
  end;
  generator.resolveOverrides();
  generator.write(directory);
  error=generator.getFirstError();
  if error#null then
    ui.error(error[2]); files.edit(error[0], error[1])
  end
  

A comment between /* and */ before an item is considered the item's comment and included into the collected data and generated output. The comment is output "as is", i.e. can be marked up with HTML.
The following @-tags in comments are specially processed:
  • @internal: if the only word in the comment, output of the entire item is suppressed.
  • {@link item}: insert a link to the item. See DocGenerator.resolveLink for supported item formats.
  • @param p: explains the function parameter with name p.
  • @return: explains the return value of a function.

Classes

Body An abstract class for a body containing variables and functions.
Class An m class found in the source, with base class, known subclasses and containing source.
DocGenerator A documentation generator from m source files.
Function An m function found in the source, with parameters.
Item An item found in the source, with name, position and optional comment.
Source An m source (script or module) with module aliases and contained classes.
Variable An m variable or constant found in the source.
mShell Home  > Documentation  > mdoc