/** This tool produces gsdoc files from source files.
The autogsdoc tool is a command-line utility for parsing ObjectiveC source code (header files and optionally source files) in order to generate documentation covering the public interface of the various classes, categories, and protocols in the source.
The simple way to use this is to run the command with one or more header file names as arguments ... the tool will automatically parse corresponding source files in the same directory as the headers (or the current directory, or the directory specified using the DocumentationDirectory default), and produce gsdoc and html files as output.
Even without any human assistance, this tool will produce skeleton documents listing the methods in the classes found in the source files, but more importantly it can take specially formatted comments from the source files and insert those comments into the gsdoc output.
Any comment beginning with slash and two asterisks rather than
the common slash and single asterisk, is taken to be gsdoc markup, to
be use as the description of the class or method following it. This
comment text is reformatted and then inserted into the output.
Where multiple comments are associatd with the same item, they are
joined together with a line break (<br />) between each if
necessary.
The tool can easily be used to document programs as well as libraries, simply by giving it the name of the source file containing the main() function of the program - it takes the special comments from that function and handles them specially, inserting them as a section at the end of the first chapter of the document (it creates the first chapter if necessary).
There are some cases where special extra processing is performed, predominantly in the first comment found in the source file, from which various chunks of gsdoc markup may be extracted and placed into appropriate locations in the output document -
AutogsdocSource
: is found, the remainder
of the line is taken as a source file name to be used instead of
making the assumption that each .h file processed uses a .m file
of the same name. You may supply multiple AutogsdocSource
:
lines where a header file declares items which are defined in
multiple source files.Author
: name <email-address>',
or 'By
: name <email-address>',
or 'Author
: name' or 'By
: name'
will be recognised and converted to an author element,
possibly containing an email element.
In comments being used to provide text for a method description, the following markup is removed from the text and handled specially -
Generally, the text in comments is reformatted to standardise and
indent it nicely ... the reformatting is not performed on
any text inside an <example> element.
When the text is reformatted, it is broken into whitespace separated
'words' which are then subjected to some extra processing ...
[
NSObject-init]
,
will create a reference to the init method of NSObject (either the
class proper, or any of its categories), while
[
(NSCopying)-copyWithZone:]
, creates a
reference to a method in the NSCopyIng protocol.
The tools accepts certain user defaults (which can of course be supplied as command-line arguments as usual) -
"-Declared Foundation"
when generating documentation for the GNUstep base library. This
would result in the documentation saying that NSString is declared
in Foundation/NSString.h
make
system, which is
expected to manage dependency checking itsself.
.igsdoc
extension, and the
indexing information from those files is used.Foo
is found in the file Foo
, and the
path associated with that project index is /usr/doc/proj
,
Then generated html output may reference the class as being in
/usr/doc/prj/Foo.html
.igsdoc
extension, and the
indexing information from those files is used.
The 'Up' default is used to specify the name of a document which
should be used as the 'up' link for any other documents used.
This name must not include a path or extension.
Generally, the document referred to by this default should be a
hand-edited gsdoc document which should have a back
section containing a project index. eg.