sh2doc

overview

Script for automatic documentation of shell scripts

source

Author: Ronni Grapenthin
Created: 2007-11-20
Description: This script runs though all directories specified in the field @DIRS and looks at all files whether they contain special documentation makers like:
  • BRIEF
  • AUTHOR
  • DETAILS
  • DATE
  • CHANGELOG
If any of these are found, the file is added to an overview contained in an index.html file which lists file name (and a link to a detailed description). Furthermore another HTML file is created which contains detailed information of the file given in the documentation. Additional meta data of the file such as last changed could be added.
A line that (starts with spaces only and) contains a comment starting with '+' will be added to the details.

Empty lines or "" denote that the subsection (e.g. DETAILS) is finished. So use minimal HTML for paragraph formatting and line breaks.

fill @FILES with files found in directories given by @DIRS grep all files that are executable and not a directory sort filenames (depending on first letter of the file, not the full path!) iterate over all files and check whether they contain tagged comments read index file and include alphabet selection final writing of index file ... this is inefficient, optimize, if you can!
Changelog: 2008-01-28 (rn): search for executables, includes non-tagged files / binaries in index.
2008-01-29 (rn): sorts filenames, gives separate tables for each letter
2009-10-12 (rn): added command line options