1AUTOGSDOC(1)                 GNUstep System Manual                AUTOGSDOC(1)
2
3
4

NAME

6       autogsdoc - GNUstep API documentation generator and XML->HTML converter
7
8

SYNOPSIS

10       autogsdoc  [-Files  filename]  [-GenerateHtml  YES|no]  [-Clean yes|NO]
11       [-CleanTemplates yes|NO] [-IgnoreDependencies  yes|NO]  [-MakeDependen‐
12       cies yes|NO] [-ShowDependencies yes|NO] [-HeaderDirectory path] [-Docu‐
13       mentationDirectory path] [-Declared location] [-Project title]  [-Stan‐
14       dards   yes|NO]  [-DocumentAllInstanceVariables  yes|NO]  [-DocumentIn‐
15       stanceVariables   YES|no]   [-InstanceVariablesAtEnd   yes|NO]   [-Con‐
16       stantsTemplate filename] [-FunctionsTemplate filename] [-MacrosTemplate
17       filename] [-TypedefsTemplate  filename]  [-VariablesTemplate  filename]
18       [-SystemProjects string] [-LocalProjects string] [-Projects dictString]
19       [-Verbose yes|NO] [-Warn yes|NO] [-WordMap dictString] [files]
20
21

DESCRIPTION

23       The autogsdoc tool is a command-line utility that helps developers pro‐
24       duce  reference documentation for GNUstep APIs.  It also enables devel‐
25       opers to write and maintain other documentation in XML and have it con‐
26       verted to HTML.  In detail, autogsdoc will:
27
28       - Extract special comments describing the public interfaces of classes,
29         categories, protocols, functions, and macros from Objective C  source
30         code (header files and optionally source files) into GSDoc XML files.
31
32       - Convert  GSDoc XML files, whether generated from source code or writ‐
33         ten manually by developers, into HTML.
34
35       - Construct indices based on GSDoc XML file sets, and convert those  to
36         HTML as well.
37
38
39       The  most  common  usage  this  is  to run the command with one or more
40       header file names as arguments ... the tool  will  automatically  parse
41       corresponding source files in the same directory as the headers (or the
42       current directory, or the  directory  specified  using  the  Documenta‐
43       tionDirectory  default),  and  produce  GSDoc and HTML files as output.
44       For best results this mode should be run from the directory  containing
45       the  source files.  (Note that since C is a subset of Objective C, this
46       tool can operate to document functions and other C structures in  plain
47       C source.)
48
49       GSDoc  files  may  also be given directly in addition or by themselves,
50       and will be converted to HTML.  See the GSDoc HTML documentation or the
51       gsdoc(7) man page for information on the GSDoc format.
52
53       Finally, HTML files may be given on the command line.  Cross-references
54       to other parts of code documentation found within them will be  rewrit‐
55       ten based on what is found in the project currently.
56
57

SOURCE CODE MARKUP

59       The source code parser will automatically produce GSDoc documents list‐
60       ing the methods in the classes found in the source files, and  it  will
61       include text from specially formatted comments from the source files.
62
63       Any comment beginning with slash and two asterisks rather than the com‐
64       mon slash and single asterisk, is taken to be GSDoc markup, to  be  use
65       as  the  description of the class or method following it.  This comment
66       text is reformatted and then inserted into the output.
67       Where multiple comments are associated with the  same  item,  they  are
68       joined together with a line break (<br/>) between each if necessary.
69
70       The  tool can easily be used to document programs as well as libraries,
71       simply by giving it the name of the source file containing  the  main()
72       function of the program - it takes the special comments from that func‐
73       tion and handles them specially, inserting them as a section at the end
74       of  the  first chapter of the document (it creates the first chapter if
75       necessary).
76
77       Options are described in the section Arguments and Defaults below.
78
79

EXTRA MARKUP

81       There are some cases where special extra processing is performed,  pre‐
82       dominantly  in  the  first comment found in the source file, from which
83       various chunks of GSDoc markup may be extracted and placed into  appro‐
84       priate locations in the output document -
85
86       AutogsdocSource:
87           In  any  line where AutogsdocSource: is found, the remainder of the
88           line is taken as a source file name to be used  instead  of  making
89           the  assumption  that  each .h file processed uses a .m file of the
90           same name.  You may supply multiple AutogsdocSource: lines where  a
91           header  file  declares  items  which are defined in multiple source
92           files.  If a file name is absolute, it is used just as supplied. If
93           on  the  other  hand, it is a relative path, the software looks for
94           the source file first relative to the location of the header  file,
95           and  if not found there, relative to the current directory in which
96           autogsdoc is running, and finally relative to the directory  speci‐
97           fied by the DocumentationDirectory default.
98
99       <abstract>
100           An  abstract  of the content of the document ... placed in the head
101           of the GSDoc output.
102
103       <author>
104           A description of the author of the code - may be repeated to handle
105           the case where a document has multiple authors.  Placed in the head
106           of the GSDoc output.  As an aid to readability of the source,  some
107           special  additional processing is performed related to the document
108           author - Any line of the form 'Author:  name  <email-address>',  or
109           'By: name <email-address>', or 'Author: name' or 'By: name' will be
110           recognised and converted to an author element, possibly  containing
111           an email element.
112
113       <back>
114           Placed  in  the GSDoc output just before the end of the body of the
115           document - intended to be used for appendices, index etc..
116
117       <chapter>
118           Placed immediately before any  generated  class  documentation  ...
119           intended  to be used to provide overall description of how the code
120           being documented works.  Any documentation for the main()  function
121           of a program is inserted as a section at the end of this chapter.
122
123       <copy>
124           Copyright  of the content of the document ... placed in the head of
125           the GSDoc output.  As an aid to readability  of  the  source,  some
126           special  additional  processing is performed - Any line of the form
127           'Copyright (C) text' will be recognised and  converted  to  a  copy
128           element.
129
130       <date>
131           Date  of the revision of the document ... placed in the head of the
132           GSDoc output.  If this is omitted the tool will try to construct  a
133           value from the RCS Date tag (if available).
134
135       <front>
136           Inserted into the document at the start of the body ... intended to
137           provide for introduction or contents pages etc.
138
139       <title>
140           Title of the document ... placed in the head of the  GSDoc  output.
141           If  this  is omitted the tool will generate a (probably poor) title
142           of its own - so you should include this markup manually.
143
144       <version>
145           Version identifier of the document ... placed in the  head  of  the
146           GSDoc  output.  If this is omitted the tool will try to construct a
147           value from the RCS Revision tag (if available).
148
149       NB The markup just described may be used  within  class,  category,  or
150       protocol documentation ... if so, it is extracted and wrapped round the
151       rest of the documentation for the class as the  class's  chapter.   The
152       rest  of the class documentation is normally inserted at the end of the
153       chapter, but may instead be substituted  in  in  place  of  the  <unit>
154       pseudo-element within the <chapter> element.
155
156

METHOD MARKUP

158       In  comments  being  used to provide text for a method description, the
159       following markup is removed from the text and handled specially -
160
161       <init>
162           The method is marked as being the designated  initialiser  for  the
163           class.
164
165       <override-subclass>
166           The  method  is  marked as being one which subclasses must override
167           (e.g. an abstract method).
168
169       <override-never>
170           The method is marked as being one which subclasses should NOT over‐
171           ride.
172
173       <standards>
174           The  markup  is removed from the description and placed after it in
175           the GSDoc output - so that the method is  described  as  conforming
176           (or not conforming) to the specified standards.
177
178

AUTOMATED MARKUP

180       Generally,  the  text  in  comments  is  reformatted to standardise and
181       indent it nicely ... the reformatting is  not  performed  on  any  text
182       inside  an <example> element.  When the text is reformatted, it is bro‐
183       ken into whitespace separated
184
185           Certain well known constants such as YES, NO, and nil are  enclosed
186           in <code>
187
188           The  names  of  method  arguments  within  method  descriptions are
189           enclosed in <var> ... </var> markup.
190
191           Method names (beginning with a  plus  or  minus)  are  enclosed  in
192           <ref...>  wrapped in a GSDoc reference element to point to the init
193           method of the current class or, if only one known class had an init
194           method,  it would refer to the method of that class.  Note the fact
195           that the method name must be surrounded by whitespace to be  recog‐
196           nized  (though  a  comma,  fullstop, or semicolon at the end of the
197           specifier will act like whitespace).
198
199           Method specifiers including class names (beginning and ending  with
200           square  brackets) are enclosed in <ref...> ... </ref> markup.  e.g.
201           '[NSObject-init]', will create a reference to the  init  method  of
202           NSObject (either the class proper, or any of its categories), while
203           NSCopying protocol.  Note that no spaces must  appear  between  the
204           square  brackets  in these specifiers.  Protocol names are enclosed
205           in round brackets rather than the customary angle brackets, because
206           GSDoc is an XML language, and XML treats angle brackets specially.
207
208           Function  names (ending with '()') other than 'main()' are enclosed
209           in <ref...>  ...  </ref>  markup.   E.g.  "NSLogv()"  (without  the
210           quotes)  would  be wrapped in a GSDoc reference element to point to
211           the documentation of the NSLog function.  Note the  fact  that  the
212           function  name  must  be  surrounded by whitespace (though a comma,
213           fullstop, or semicolon at the end of the specifier will also act as
214           a whitespace terminator).
215
216

ARGUMENTS AND DEFAULTS

218       The tool accepts certain user defaults (which can of course be supplied
219       as command-line arguments by prepending '-' before the default name and
220       giving the value afterwards, as in -Clean YES):
221
222       Clean
223           If  this  boolean  value is set to YES, then rather than generating
224           documentation, the tool removes all GSDoc files  generated  in  the
225           project,  and  all  html  files generated from them (as well as any
226           which would be generated from GSDoc files listed  explicitly),  and
227           finally removes the project index file.  The only exception to this
228           is that template GSDoc files (i.e.  those  specified  using  "-Con‐
229           stantsTemplate  ...",  "-FunctionsTemplate ..."  arguments etc) are
230           not deleted unless the CleanTemplates flag is set.
231
232       CleanTemplates
233           This flag specifies whether template GSDoc files are to be  removed
234           along  with  other  files  when the Clean option is specified.  The
235           default is for them not to be removed ... since these templates may
236           have been produced manually and just had data inserted into them.
237
238       ConstantsTemplate
239           Specify  the  name  of a template document into which documentation
240           about constants should be inserted from all files in  the  project.
241           This is useful if constants in the source code are scattered around
242           many files, and you need to group them into  one  place.   You  are
243           responsible  for  ensuring  that  the basic template document (into
244           which individual constant documentation is inserted)  contains  all
245           the other information you want, but as a convenience autogsdoc will
246           generate a simple template (which you may then edit) for you if the
247           file  does not exist.  Insertion takes place immediately before the
248           back element (or if that does not exist, immediately before the end
249           of the body element) in the template.
250
251       Declared
252           Specify  where  headers  are  to be documented as being found.  The
253           actual name produced in the documentation is  formed  by  appending
254           the  last  component  of  the header file name to the value of this
255           default.  If this default is not specified, the full  name  of  the
256           header  file  (as supplied on the command line), with the HeaderDi‐
257           rectory default prepended, is used.  A typical usage of this  might
258           be  '"-Declared  Foundation"' when generating documentation for the
259           GNUstep base library.  This would result in the documentation  say‐
260           ing that NSString is declared in 'Foundation/NSString.h'
261
262       DocumentAllInstanceVariables
263           This  flag  permits  you to generate documentation for all instance
264           variables.  Normally, only those explicitly declared 'public' or
265
266       DocumentInstanceVariables
267           This flag permits you to turn off documentation for instance  vari‐
268           ables  completely.  Normally, explicitly declared 'public' or 'pro‐
269           tected' instance variables will be documented.
270
271       InstanceVariablesAtEnd
272           This flag, if set, directs the HTML  generator  to  place  instance
273           variable  documentation  at  the  end  of the class, instead of the
274           beginning.  This is useful if you use a lot of  protected  instance
275           variables  which are only going to be of secondary interest to gen‐
276           eral users of the class.
277
278       DocumentationDirectory
279           May be used to specify the directory in which generated  documenta‐
280           tion  is to be placed.  If this is not set, output is placed in the
281           current directory.  This directory is also used as a last resort to
282           locate source files (not headers), and more importantly, it is used
283           as the first and only resort to locate any .gsdoc  files  that  are
284           passed  in  on  the  command  line.  Any path information given for
285           these files is removed and they are  searched  for  in  'Documenta‐
286           tionDirectory' (even though they may not have been autogenerated).
287
288       Files
289           Specifies  the  name of a file containing a list of file names as a
290           property list array (name1,name2,...)  format.  If this is present,
291           filenames in the program argument list are ignored and the names in
292           this file are used as the list of names to process.
293
294       FunctionsTemplate
295           Specify the name of a template document  into  which  documentation
296           about  functions  should be inserted from all files in the project.
297           This is useful if function source code  is  scattered  around  many
298           files,  and you need to group it into one place.  You are responsi‐
299           ble for ensuring that the basic template document (into which indi‐
300           vidual  function  documentation is inserted) contains all the other
301           information you want, but as a convenience autogsdoc will  generate
302           a  simple  template  (which  you may then edit) for you if the file
303           does not exist.  Insertion takes place immediately before the  back
304           element  (or  if that does not exist, immediately before the end of
305           the body element) in the template.
306
307       GenerateHtml
308           May be used to specify if HTML output is to be generated.  Defaults
309           to YES.
310
311       HeaderDirectory
312           May  be  used  to  specify  the directory to be searched for header
313           files.  When supplied, this value is prepended to  relative  header
314           names, otherwise the relative header names are interpreted relative
315           to the current directory.  Header files specified as absolute paths
316           are not influenced by this default.
317
318       IgnoreDependencies
319           A  boolean  value  which  may  be  used to specify that the program
320           should ignore file modification times and regenerate files  anyway.
321           Provided  for  use  in conjunction with the 'make' system, which is
322           expected to manage dependency checking itsself.
323
324       LocalProjects
325           This value is used to control  the  automatic  inclusion  of  local
326           external projects into the indexing system for generation of cross-
327           references in final document output.  If set  to  'None',  then  no
328           local  project  references are done, otherwise, the 'Local' GNUstep
329           documentation directory is recursively searched for  files  with  a
330           '.igsdoc'  extension, and the indexing information from those files
331           is used.  The value of this string is also  used  to  generate  the
332           filenames  in the cross reference ... if it is an empty string, the
333           path to use is assumed to be a file in the same directory where the
334           igsdoc file was found, otherwise it is used as a prefix to the name
335           in the index.  NB. Local projects with the same name as the project
336           currently  being documented will not be included by this mechanism.
337           If you wish to include such projects, you  must  do  so  explicitly
338           using -Projects ...
339
340       MacrosTemplate
341           Specify  the  name  of a template document into which documentation
342           about macros should be inserted from  all  files  in  the  project.
343           This  is  useful  if macro code is scattered around many files, and
344           you need to group it into  one  place.   You  are  responsible  for
345           ensuring  that  the  basic template document (into which individual
346           macro documentation is inserted) contains all the other information
347           you  want,  but  as  a convenience autogsdoc will generate a simple
348           template (which you may then edit) for you if  the  file  does  not
349           exist.   Insertion  takes place immediately before the back element
350           (or if that does not exist, immediately before the end of the body
351            element) in the template.
352
353       MakeDependencies
354           A filename to be used to output dependency  information  for  make.
355           This  will  take  the  form  of listing all header and source files
356           known for the project as dependencies of the project name (see
357
358       Project
359           May be used to specify the name of this project ... determines  the
360           name of the index reference file produced as part of the documenta‐
361           tion to provide information enabling other projects to cross-refer‐
362           ence to items in this project.
363
364       Projects
365           This  value may be supplied as a dictionary containing the paths to
366           the igsdoc index/reference files used by external  projects,  along
367           with  values  to be used to map the filenames found in the indexes.
368           For example, if a project index (igsdoc) file says that  the  class
369           path  associated  with  that project index is '/usr/doc/proj', Then
370           generated html output may reference the class as being in given  on
371           the command line by using the standard PropertyList format (not the
372           XML format of OS  X),  using  semicolons  as  line-separators,  and
373           enclosing it in single quotes.
374
375       ShowDependencies
376           A  boolean  value  which  may  be  used to specify that the program
377           should log which files  are  being  regenerated  because  of  their
378           dependencies on other files.
379
380       Standards
381           A  boolean  value used to specify whether the program should insert
382           information about  standards  complience  into  the  documentation.
383           This should only be used when documenting the GNUstep libraries and
384           tools themselves as it assumes that the code  being  documented  is
385           part of GNUstep and possibly complies with the OpenStep standard or
386           implements MacOS-X compatible methods.
387
388       SystemProjects
389           This value is used to control the  automatic  inclusion  of  system
390           external projects into the indexing system for generation of cross-
391           references in final document output.  If set  to  'None',  then  no
392           system project references are done, otherwise, the 'System' GNUstep
393           documentation directory is recursively searched for  files  with  a
394           '.igsdoc'  extension, and the indexing information from those files
395           is used.  The value of this string is also  used  to  generate  the
396           filenames  in the cross reference ... if it is an empty string, the
397           path to use is assumed to be a file in the same directory where the
398           igsdoc file was found, otherwise it is used as a prefix to the name
399           in the index.  NB. System  projects  with  the  same  name  as  the
400           project  currently  being  documented  will not be included by this
401           mechanism.  If you wish to include such projects, you  must  do  so
402           explicitly using -Projects ...
403
404       TypedefsTemplate
405           Specify  the  name  of a template document into which documentation
406           about typedefs should be inserted from all files  in  the  project.
407           This  is  useful  if  typedef  source code is scattered around many
408           files, and you need to group it into one place.  You are  responsi‐
409           ble for ensuring that the basic template document (into which indi‐
410           vidual typedef documentation is inserted) contains  all  the  other
411           information  you want, but as a convenience autogsdoc will generate
412           a simple template (which you may then edit) for  you  if  the  file
413           does  not exist.  Insertion takes place immediately before the back
414           element (or if that does not exist, immediately before the  end  of
415           the body element) in the template.
416
417       Up  A  string  used to supply the name to be used in the 'up' link from
418           generated GSDoc documents.  This should normally be the name  of  a
419           file which contains an index of the contents of a project.  If this
420           is missing or set to an empty string, then no  'up'  link  will  be
421           provided in the documents.
422
423       VariablesTemplate
424           Specify  the  name  of a template document into which documentation
425           about variables should be inserted from all files in  the  project.
426           This  is  useful  if  variable source code is scattered around many
427           files, and you need to group it into one place.  You are  responsi‐
428           ble for ensuring that the basic template document (into which indi‐
429           vidual variable documentation is inserted) contains all  the  other
430           information  you want, but as a convenience autogsdoc will generate
431           a simple template (which you may then edit) for  you  if  the  file
432           does  not exist.  Insertion takes place immediately before the back
433           element (or if that does not exist, immediately before the  end  of
434           the body element) in the template.
435
436       Verbose
437           A  boolean  used  to specify whether you want verbose debug/warning
438           output to be produced.
439
440       Warn
441           A boolean used to specify whether you want standard warning  output
442           (e.g. report of undocumented methods) produced.
443
444       WordMap
445           This  value  is a dictionary used to map identifiers/keywords found
446           in the source files  to other words.  Generally you will  not  have
447           to  use this, but it is sometimes helpful to avoid the parser being
448           confused by the use of C preprocessor macros.  You can  effectively
449           redefine  the macro to something less confusing.  The value you map
450           the identifier to must be one of -  Another  identifier,  An  empty
451           string - the value is ignored, Two slashes ('//') - the rest of the
452           line is ignored.  Note that a dictionary may be given on  the  com‐
453           mand  line  by  using the standard PropertyList format (not the XML
454           format of OS X), using semicolons as line-separators, and enclosing
455           it in single quotes.
456
457

INTER-DOCUMENT LINKAGE

459       The 'Up' default is used to specify the name of a document which should
460       be used as the 'up' link for any other documents used. This  name  must
461       not include a path or extension. Generally, the document referred to by
462       this default should be a hand-edited GSDoc document which should have a
463       <em>back</em> section containing a project index. e.g.
464
465       <?xml version="1.0"?>
466       <!DOCTYPE gsdoc PUBLIC "-//GNUstep//DTD gsdoc 1.0.3//EN"
467                               "http://www.gnustep.org/gsdoc-1_0_3.xml">
468       <gsdoc base="index">
469         <head>
470           <title>My project reference</title>
471           <author name="my name"></author>
472         </head>
473         <body>
474           <chapter>
475             <heading>My project reference</heading>
476           </chapter>
477           <back>
478             <index scope="project" type="title" />
479           </back>
480         </body>
481       </gsdoc>
482
483

FILES

485       Source: .h, .m, .c
486       GSDoc:  .gsdoc
487       Index:  .igsdoc
488       HTML:   .html
489
490

BUGS

492       Several  GSDoc elements are not rendered properly into HTML yet.  These
493       are: <prjref>, <EOEntity>, <EOModel>.
494
495

DIAGNOSTICS

497       Error messages and warnings can come from each of  the  stages  of  the
498       pipeline:  top-level control, source parsing, GSDoc parsing, and index‐
499       ing.
500
501

SEE ALSO

503       gsdoc(7), GNUstep(7)
504

HISTORY

506       Autogsdoc combined the capabilities of two earlier tools, 'autodoc' and
507       'gsdoc', which performed the source->GSDoc and GSDoc->HTML translations
508       respectively.  These earlier tools and the GSDoc format were  developed
509       for GNUstep based on the earlier GDML SGML language.
510
511       This manual page first appeared in gnustep-base 1.9.2 (March 2004).
512

AUTHORS

514       autogsdoc was written by Richard Frith-McDonald <rfm@gnu.org>
515
516       This manual page added by Adrian Robert <arobert@cogsci.ucsd.edu>.
517
518
519
520GNUstep                           March 2004                      AUTOGSDOC(1)
Impressum