diff --git a/ChangeLog b/ChangeLog
index ba5a7f6c4..d055a5bf5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2001-12-18 Richard Frith-Macdonald
+
+ * Tools/AGSHtml.m: Output tidyups and general format improvements.
+ Add lins to other documents in project.
+ * Tools/autogsdoc.m: Clean up a little and handle gsdoc files
+ listed as source files better .... now looks for them in the
+ source directory.
+
2001-12-17 Richard Frith-Macdonald
* Headers/gnustep/base/GSMime.h: Updates for autogsdoc
diff --git a/Tools/AGSHtml.m b/Tools/AGSHtml.m
index 1afb504d0..4e7d8984f 100644
--- a/Tools/AGSHtml.m
+++ b/Tools/AGSHtml.m
@@ -282,7 +282,7 @@ static NSMutableSet *textNodes = nil;
[buf appendString: @"\n"];
[self incIndent];
- [self outputNodeList: [node children] to: buf];
+ [self outputNodeList: node to: buf];
[self decIndent];
[buf appendString: @"\n"];
@@ -316,6 +316,25 @@ static NSMutableSet *textNodes = nil;
{
/* Should already be in html body */
[self outputNodeList: children to: buf];
+
+ [buf appendString: indent];
+ [buf appendString: @"
\n"];
+ if (prevFile != nil)
+ {
+ [buf appendString: indent];
+ [buf appendFormat: @"Prev\n", prevFile];
+ }
+ if (upFile != nil)
+ {
+ [buf appendString: indent];
+ [buf appendFormat: @"Up\n", upFile];
+ }
+ if (nextFile != nil)
+ {
+ [buf appendString: indent];
+ [buf appendFormat: @"Next\n", nextFile];
+ }
+
[self decIndent];
[buf appendString: indent];
[buf appendString: @"
\n"];
[self incIndent];
+
+ if (prevFile != nil)
+ {
+ [buf appendString: indent];
+ [buf appendFormat: @"Prev\n", prevFile];
+ }
+ if (upFile != nil)
+ {
+ [buf appendString: indent];
+ [buf appendFormat: @"Up\n", upFile];
+ }
+ if (nextFile != nil)
+ {
+ [buf appendString: indent];
+ [buf appendFormat: @"Next\n", nextFile];
+ }
+ [buf appendString: indent];
+ [buf appendString: @"
\n"];
+
[buf appendString: indent];
[buf appendString: @""];
[self outputText: [children children] to: buf];
@@ -854,7 +892,8 @@ NSLog(@"Element '%@' not implemented", name); // FIXME
tmp = [node children];
if (tmp != nil)
{
- [buf appendString: @"Standards:"];
+ [buf appendString: indent];
+ [buf appendString: @"Standards:"];
while (tmp != nil)
{
[buf appendString: @" "];
@@ -888,7 +927,7 @@ NSLog(@"Element '%@' not implemented", name); // FIXME
[self outputNode: node to: buf];
}
[buf appendString: indent];
- [buf appendString: @"
\n"];
+ [buf appendString: @"
\n"];
}
}
else if ([name isEqual: @"p"] == YES)
@@ -1289,26 +1328,60 @@ NSLog(@"Element '%@' not implemented", name); // FIXME
if (node != nil && [[node name] isEqual: @"declared"] == YES)
{
[buf appendString: indent];
- [buf appendString: @"Declared: "];
- [self outputText: [node children] to: buf];
- [buf appendString: @"
\n"];
- node = [node next];
- }
- while (node != nil && [[node name] isEqual: @"conform"] == YES)
- {
- NSString *text = [[node children] content];
-
+ [buf appendString: @"\n"];
+ [self incIndent];
[buf appendString: indent];
- [buf appendString: @"Conform: "];
- [buf appendString: [self protocolRef: text]];
- [buf appendString: @"
\n"];
+ [buf appendString: @"\n"];
+ [self incIndent];
+ [buf appendString: indent];
+ [buf appendString: @"- Declared in:
\n"];
+ [buf appendString: indent];
+ [buf appendString: @"- "];
+ [self outputText: [node children] to: buf];
+ [buf appendString: @"
\n"];
+ [self decIndent];
+ [buf appendString: indent];
+ [buf appendString: @"
\n"];
+ [self decIndent];
+ [buf appendString: indent];
+ [buf appendString: @"
\n"];
node = [node next];
}
+
+ if (node != nil && [[node name] isEqual: @"conform"] == YES)
+ {
+ [buf appendString: indent];
+ [buf appendString: @"\n"];
+ [self incIndent];
+ [buf appendString: indent];
+ [buf appendString: @"\n"];
+ [self incIndent];
+ [buf appendString: indent];
+ [buf appendString: @"- Conforms to:
\n"];
+ while (node != nil && [[node name] isEqual: @"conform"] == YES)
+ {
+ NSString *text = [[node children] content];
+
+ [buf appendString: indent];
+ [buf appendString: @"- "];
+ [buf appendString: [self protocolRef: text]];
+ [buf appendString: @"
\n"];
+ node = [node next];
+ }
+ [self decIndent];
+ [buf appendString: indent];
+ [buf appendString: @"
\n"];
+ [self decIndent];
+ [buf appendString: indent];
+ [buf appendString: @"
\n"];
+ }
+
if (node != nil && [[node name] isEqual: @"desc"] == YES)
{
[self outputNode: node to: buf];
node = [node next];
}
+
a = [localRefs methodsInUnit: unit];
if ([a count] > 0)
{
@@ -1317,7 +1390,9 @@ NSLog(@"Element '%@' not implemented", name); // FIXME
[a sortUsingSelector: @selector(compare:)];
[buf appendString: indent];
- [buf appendString: @"Methods
\n"];
+ [buf appendString: @"
\n"];
+ [buf appendString: indent];
+ [buf appendString: @"Method summary
\n"];
[buf appendString: indent];
[buf appendString: @"\n"];
[self incIndent];
@@ -1334,6 +1409,8 @@ NSLog(@"Element '%@' not implemented", name); // FIXME
[self decIndent];
[buf appendString: indent];
[buf appendString: @"
\n"];
+ [buf appendString: indent];
+ [buf appendString: @"
\n"];
}
while (node != nil && [[node name] isEqual: @"method"] == YES)
{
@@ -1342,7 +1419,20 @@ NSLog(@"Element '%@' not implemented", name); // FIXME
}
if (node != nil && [[node name] isEqual: @"standards"] == YES)
{
- [self outputNode: node to: buf];
+ GSXMLNode *tmp = node;
+
+ if (tmp != nil)
+ {
+ [buf appendString: indent];
+ [buf appendString: @"Standards:"];
+ while (tmp != nil)
+ {
+ [buf appendString: @" "];
+ [buf appendString: [tmp name]];
+ tmp = [tmp next];
+ }
+ [buf appendString: @"
\n"];
+ }
node = [node next];
}
}
diff --git a/Tools/autogsdoc.m b/Tools/autogsdoc.m
index 3d92a987e..4cffa0103 100644
--- a/Tools/autogsdoc.m
+++ b/Tools/autogsdoc.m
@@ -238,8 +238,10 @@
on other files.
- SourceDirectory
- May be used to specify the directory to be searched for header files.
- If this is not specified, headers are looked for relative to the
+ May be used to specify the directory to be searched for source
+ (anything other than
.h
files ... which are controlled
+ by the HeaderDirectory default).
+ If this is not specified, sources are looked for relative to the
current directory or using absolute path names if given.
- SystemProjects
@@ -307,7 +309,6 @@ main(int argc, char **argv, char **env)
NSString *up = nil;
NSString *prev = nil;
BOOL showDependencies = YES;
- id o;
CREATE_AUTORELEASE_POOL(outer);
CREATE_AUTORELEASE_POOL(pool);
@@ -496,7 +497,7 @@ main(int argc, char **argv, char **env)
}
else if ([arg hasSuffix: @".h"] == YES
|| [arg hasSuffix: @".m"] == YES
- || [arg hasSuffix: @".gsdoc"]== YES)
+ || [arg hasSuffix: @".gsdoc"] == YES)
{
NSString *gsdocfile;
NSString *hfile;
@@ -560,61 +561,66 @@ main(int argc, char **argv, char **env)
AUTORELEASE(RETAIN(sDate));
}
}
- attrs = [mgr fileAttributesAtPath: gsdocfile traverseLink: YES];
- gDate = [attrs objectForKey: NSFileModificationDate];
- AUTORELEASE(RETAIN(gDate));
- if (gDate == nil || [sDate earlierDate: gDate] == gDate)
+ if (isDocumentation == NO)
{
- if (showDependencies == YES)
- {
- NSLog(@"%@: source %@, gsdoc %@ ==> regenerate",
- file, sDate, gDate);
- }
- [parser reset];
+ /*
+ * The file we are processing is not a gsdoc file ... so
+ * we need to try to generate the gsdoc from source code.
+ */
+ attrs = [mgr fileAttributesAtPath: gsdocfile traverseLink: YES];
+ gDate = [attrs objectForKey: NSFileModificationDate];
+ AUTORELEASE(RETAIN(gDate));
- if (isSource == NO && isDocumentation == NO)
+ if (gDate == nil || [sDate earlierDate: gDate] == gDate)
{
- /*
- * Try to parse header to see what needs documenting.
- */
- if ([mgr isReadableFileAtPath: hfile] == NO)
+ if (showDependencies == YES)
{
- NSLog(@"No readable header at '%@' ... skipping",
- hfile);
- continue;
+ NSLog(@"%@: source %@, gsdoc %@ ==> regenerate",
+ file, sDate, gDate);
+ }
+ [parser reset];
+
+ if (isSource == NO)
+ {
+ /*
+ * Try to parse header to see what needs documenting.
+ */
+ if ([mgr isReadableFileAtPath: hfile] == NO)
+ {
+ NSLog(@"No readable header at '%@' ... skipping",
+ hfile);
+ continue;
+ }
+ if (declared != nil)
+ {
+ [parser setDeclared:
+ [declared stringByAppendingPathComponent:
+ [hfile lastPathComponent]]];
+ }
+ [parser parseFile: hfile isSource: NO];
+ }
+ else if (isSource == YES)
+ {
+ /*
+ * Try to parse source *as-if-it-was-a-header*
+ * to see what needs documenting.
+ */
+ if ([mgr isReadableFileAtPath: sfile] == NO)
+ {
+ NSLog(@"No readable source at '%@' ... skipping",
+ sfile);
+ continue;
+ }
+ if (declared != nil)
+ {
+ [parser setDeclared:
+ [declared stringByAppendingPathComponent:
+ [sfile lastPathComponent]]];
+ }
+ [parser parseFile: sfile isSource: NO];
}
- if (declared != nil)
- {
- [parser setDeclared:
- [declared stringByAppendingPathComponent:
- [hfile lastPathComponent]]];
- }
- [parser parseFile: hfile isSource: NO];
- }
- else if (isSource == YES)
- {
- /*
- * Try to parse source *as-if-it-was-a-header*
- * to see what needs documenting.
- */
- if ([mgr isReadableFileAtPath: sfile] == NO)
- {
- NSLog(@"No readable source at '%@' ... skipping",
- sfile);
- continue;
- }
- if (declared != nil)
- {
- [parser setDeclared:
- [declared stringByAppendingPathComponent:
- [sfile lastPathComponent]]];
- }
- [parser parseFile: sfile isSource: NO];
- }
- if (isDocumentation == NO)
- {
/*
* If we can read a source file, parse it for any
* additional information on items found in the header.
@@ -671,7 +677,24 @@ main(int argc, char **argv, char **env)
}
}
}
+ else
+ {
+ /*
+ * Our source file is a gsdoc file ... so it may be located
+ * in the source (input) directory rather than the documentation
+ * (output) directory.
+ */
+ if ([mgr isReadableFileAtPath: gsdocfile] == NO)
+ {
+ gsdocfile = [sdir stringByAppendingPathComponent: file];
+ gsdocfile = [gsdocfile stringByAppendingPathExtension:
+ @"gsdoc"];
+ }
+ }
+ /*
+ * Now we try to process the gsdoc data to make index info.
+ */
if ([mgr isReadableFileAtPath: gsdocfile] == YES)
{
GSXMLParser *parser;
@@ -751,6 +774,28 @@ main(int argc, char **argv, char **env)
htmlfile = [ddir stringByAppendingPathComponent: file];
htmlfile = [htmlfile stringByAppendingPathExtension: @"html"];
+ /*
+ * If the gsdoc file name was specified as a source file,
+ * it may be in the source directory rather than the documentation
+ * directory.
+ */
+ if ([mgr isReadableFileAtPath: gsdocfile] == NO
+ && [arg hasSuffix: @".gsdoc"] == YES)
+ {
+ NSString *sdir = [arg stringByDeletingLastPathComponent];
+
+ if ([sdir length] == 0)
+ {
+ sdir = sourceDirectory;
+ }
+ else if ([sdir isAbsolutePath] == NO)
+ {
+ sdir = [sourceDirectory stringByAppendingPathComponent: sdir];
+ }
+ gsdocfile = [sdir stringByAppendingPathComponent: file];
+ gsdocfile = [gsdocfile stringByAppendingPathExtension: @"gsdoc"];
+ }
+
/*
* When were the files last modified?
*/