six demon bag

Wind, fire, all that kind of thing!

2016-02-27

VBSdoc - A VBScript API Documentation Generator

API documentation is nice, and being able to generate it from the code is even nicer. However, unlike Perl, Python, Java, or several other languages, VBScript doesn't have a feature or tool that supports this. Which kinda sucks.

I tried VBDOX, but didn't find usability or results too convincing. I also tried doxygen by adapting Basti Grembowietz' Visual Basic doxygen filter. However, doxygen does a lot of things I don't actually need, and I didn't manage to make it do some of the things I do need. Thus I ended up writing my own VBScript documentation generator.


Download

Version 2.6 (2016-02-27; added parameter for specifying extension of files to process; separated @date output from @version output; @author and @date can now be used with any element)

Version 2.5 (2015-02-27; added portuguese localization contributed by Luis Da Costa; highlighting of default properties/methods is now configurable via CSS; description text for @see URLs now becomes the link text)

Version 2.4 (2014-11-03; added support for UTF-8 and UTF-16 encoded input files; using parameter /i without an argument now raises an error)

Version 2.3 (2012-09-18; global index page now lists classes and global procedures/functions/variables/constants from all source files; fixed creation of incorrect stylesheet references)

Version 2.2 (2012-08-14; fixed a bug in handling ambiguous names and changed logging to CLogger)

Version 2.1 (2011-01-13; @see allows additional descriptive text, output conforms to XHTML 1.0 Transitional)

Version 2.0 (2010-12-31; added HTML Help generation, added handling of default items and parameterized properties)

Version 1.0 (2010-11-29; initial release)

Requirements

  • VBSdoc uses my CLogger class for displaying messages (VBSdoc 2.1 and earlier use this version).
  • For generation of compiled HTML Help files, HTML Help Workshop must be installed and the HTML Help compiler hhc.exe must be in the %PATH% of the user running VBSdoc.

Doc Comment Example

'! Return a slice (sub-array) from a given source array.
'!
'! @param  arr    The source array.
'! @param  first  Index of the beginning of the slice.
'! @param  last   Index of the end of the slice.
'! @return A slice from the given array.
'!
'! @see http://somepage.example.org/ (description text)

Function Slice(arr, first, last)
  '...
End Function

If you're familiar with Javadoc, you probably recognized the syntax. Basically a doc comment starts with a single quote and an exclamation mark, followed by a tag and descriptive text. See README.txt for details and a complete list of supported tags.

Commandline Arguments

VBSdoc.vbs [/d] [/a] [/q] [/l:LANG] [/p:NAME] [/e:EXT] [/h:CHM_FILE] /i:SOURCE /o:DOC_DIR
VBSdoc.vbs /?

  /?  Print this help.
  /a  Generate documentation for all elements (public and private).
      Without this option, documentation is generated for public
      elements only.
  /d  Enable debug messages. (you really don't want this)
  /e  Process files with the given extension (default: vbs).
  /h  Create CHM_FILE in addition to normal HTML output. (requires
      HTML Help Workshop)
  /i  Read input files from SOURCE. Can be either a file or a
      directory. (required)
  /l  Create localized output (available: de,en,pt; default: en).
  /o  Generate output files in DOC_DIR. (required)
  /p  Use NAME as the project name.
  /q  Don't print warnings. Ignored if debug messages are enabled.

Copyright

VBSdoc is distributed according to the terms of the GNU General Public License Version 2.0.

Posted 16:31 [permalink]