From 92cb1fb37b84fa588e957933ccb8a942f4e22184 Mon Sep 17 00:00:00 2001 From: CaS Date: Tue, 18 Dec 2001 11:29:02 +0000 Subject: [PATCH] Tidied to fix failures to meet DTD git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@11806 72102866-910b-0410-8b05-ffd578937521 --- Tools/AGSHtml.m | 2 +- Tools/AGSOutput.m | 24 +++++++++++++++++++++--- Tools/autogsdoc.m | 5 ++++- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/Tools/AGSHtml.m b/Tools/AGSHtml.m index fbf9fdfa8..9c47ca709 100644 --- a/Tools/AGSHtml.m +++ b/Tools/AGSHtml.m @@ -732,7 +732,7 @@ static NSMutableSet *textNodes = nil; if ([[children name] isEqual: @"copy"] == YES) { [buf appendString: indent]; - [buf appendString: @"

Copyright: (C) "]; + [buf appendString: @"

Copyright: (C) "]; [self outputText: [children children] to: buf]; [buf appendString: @"

\n"]; children = firstElement([children next]); diff --git a/Tools/AGSOutput.m b/Tools/AGSOutput.m index 8487a7fed..468637d97 100644 --- a/Tools/AGSOutput.m +++ b/Tools/AGSOutput.m @@ -187,6 +187,7 @@ static BOOL snuggleStart(NSString *t) NSDictionary *protocols; NSArray *authors; NSString *tmp; + unsigned chapters = 0; info = d; @@ -338,16 +339,19 @@ static BOOL snuggleStart(NSString *t) if (tmp != nil) { [self reformat: tmp withIndent: 4 to: str]; + chapters++; } if ([classes count] > 0) { NSArray *names; unsigned i; + unsigned c = [classes count]; + chapters += c; names = [classes allKeys]; names = [names sortedArrayUsingSelector: @selector(compare:)]; - for (i = 0; i < [names count]; i++) + for (i = 0; i < c; i++) { NSString *name = [names objectAtIndex: i]; NSDictionary *d = [classes objectForKey: name]; @@ -360,10 +364,12 @@ static BOOL snuggleStart(NSString *t) { NSArray *names; unsigned i; + unsigned c = [categories count]; + chapters += c; names = [categories allKeys]; names = [names sortedArrayUsingSelector: @selector(compare:)]; - for (i = 0; i < [names count]; i++) + for (i = 0; i < c; i++) { NSString *name = [names objectAtIndex: i]; NSDictionary *d = [categories objectForKey: name]; @@ -376,10 +382,12 @@ static BOOL snuggleStart(NSString *t) { NSArray *names; unsigned i; + unsigned c = [protocols count]; + chapters += c; names = [protocols allKeys]; names = [names sortedArrayUsingSelector: @selector(compare:)]; - for (i = 0; i < [names count]; i++) + for (i = 0; i < c; i++) { NSString *name = [names objectAtIndex: i]; NSDictionary *d = [protocols objectForKey: name]; @@ -388,6 +396,16 @@ static BOOL snuggleStart(NSString *t) } } + if (chapters == 0) + { + // We must have at least one chapter! + [str appendString: @" \n"]; + [str appendString: + @" No contents found by autogsdoc\n"]; + [str appendString: @"

\n"]; + [str appendString: @"
\n"]; + } + // Output document appendix if available. tmp = [info objectForKey: @"back"]; if (tmp != nil) diff --git a/Tools/autogsdoc.m b/Tools/autogsdoc.m index c1edc179a..8efd17ea9 100644 --- a/Tools/autogsdoc.m +++ b/Tools/autogsdoc.m @@ -594,12 +594,15 @@ main(int argc, char **argv, char **env) @" \n" @" \n" @" \n" + @" \n" + @" %@ project reference\n" + @" \n" @" \n" @" \n" @" \n" @" \n" @"\n", - file, project]; + file, project, project]; if ([upString writeToFile: upFile atomically: YES] == NO) {