mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Varuious tidyups
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@11799 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
fe6a0d9143
commit
2b0506e0c2
3 changed files with 215 additions and 72 deletions
|
@ -1,3 +1,11 @@
|
|||
2001-12-18 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* 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 <rfm@gnu.org>
|
||||
|
||||
* Headers/gnustep/base/GSMime.h: Updates for autogsdoc
|
||||
|
|
130
Tools/AGSHtml.m
130
Tools/AGSHtml.m
|
@ -282,7 +282,7 @@ static NSMutableSet *textNodes = nil;
|
|||
|
||||
[buf appendString: @"<html>\n"];
|
||||
[self incIndent];
|
||||
[self outputNodeList: [node children] to: buf];
|
||||
[self outputNodeList: node to: buf];
|
||||
[self decIndent];
|
||||
[buf appendString: @"</html>\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: @"<br />\n"];
|
||||
if (prevFile != nil)
|
||||
{
|
||||
[buf appendString: indent];
|
||||
[buf appendFormat: @"<a href=\"%@\">Prev</a>\n", prevFile];
|
||||
}
|
||||
if (upFile != nil)
|
||||
{
|
||||
[buf appendString: indent];
|
||||
[buf appendFormat: @"<a href=\"%@\">Up</a>\n", upFile];
|
||||
}
|
||||
if (nextFile != nil)
|
||||
{
|
||||
[buf appendString: indent];
|
||||
[buf appendFormat: @"<a href=\"%@\">Next</a>\n", nextFile];
|
||||
}
|
||||
|
||||
[self decIndent];
|
||||
[buf appendString: indent];
|
||||
[buf appendString: @"</body>\n"];
|
||||
|
@ -388,7 +407,7 @@ static NSMutableSet *textNodes = nil;
|
|||
unsigned l = 0;
|
||||
|
||||
[buf appendString: indent];
|
||||
[buf appendString: @"<hr />\n"];
|
||||
[buf appendString: @"<hr width=\"50%\" align=\"left\" />\n"];
|
||||
[buf appendString: indent];
|
||||
[buf appendString: @"<h3>Contents -</h3>\n"];
|
||||
|
||||
|
@ -465,7 +484,7 @@ static NSMutableSet *textNodes = nil;
|
|||
l--;
|
||||
}
|
||||
[buf appendString: indent];
|
||||
[buf appendString: @"<hr />\n"];
|
||||
[buf appendString: @"<hr width=\"50%\" align=\"left\" />\n"];
|
||||
}
|
||||
}
|
||||
else if ([name isEqual: @"desc"] == YES)
|
||||
|
@ -562,7 +581,7 @@ static NSMutableSet *textNodes = nil;
|
|||
}
|
||||
nextFile = [prop objectForKey: @"next"];
|
||||
nextFile = [nextFile stringByAppendingPathExtension: @"html"];
|
||||
prevFile = [prop objectForKey: @"pref"];
|
||||
prevFile = [prop objectForKey: @"prev"];
|
||||
prevFile = [prevFile stringByAppendingPathExtension: @"html"];
|
||||
upFile = [prop objectForKey: @"up"];
|
||||
upFile = [upFile stringByAppendingPathExtension: @"html"];
|
||||
|
@ -586,6 +605,25 @@ static NSMutableSet *textNodes = nil;
|
|||
[buf appendString: indent];
|
||||
[buf appendString: @"<body>\n"];
|
||||
[self incIndent];
|
||||
|
||||
if (prevFile != nil)
|
||||
{
|
||||
[buf appendString: indent];
|
||||
[buf appendFormat: @"<a href=\"%@\">Prev</a>\n", prevFile];
|
||||
}
|
||||
if (upFile != nil)
|
||||
{
|
||||
[buf appendString: indent];
|
||||
[buf appendFormat: @"<a href=\"%@\">Up</a>\n", upFile];
|
||||
}
|
||||
if (nextFile != nil)
|
||||
{
|
||||
[buf appendString: indent];
|
||||
[buf appendFormat: @"<a href=\"%@\">Next</a>\n", nextFile];
|
||||
}
|
||||
[buf appendString: indent];
|
||||
[buf appendString: @"<br />\n"];
|
||||
|
||||
[buf appendString: indent];
|
||||
[buf appendString: @"<h1>"];
|
||||
[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: @"<b>Standards:</b>"];
|
||||
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: @"<hr />\n"];
|
||||
[buf appendString: @"<hr width=\"25%\" align=\"left\" />\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: @"<br />\n"];
|
||||
node = [node next];
|
||||
}
|
||||
while (node != nil && [[node name] isEqual: @"conform"] == YES)
|
||||
{
|
||||
NSString *text = [[node children] content];
|
||||
|
||||
[buf appendString: @"<blockquote>\n"];
|
||||
[self incIndent];
|
||||
[buf appendString: indent];
|
||||
[buf appendString: @"Conform: "];
|
||||
[buf appendString: [self protocolRef: text]];
|
||||
[buf appendString: @"<br />\n"];
|
||||
[buf appendString: @"<dl>\n"];
|
||||
[self incIndent];
|
||||
[buf appendString: indent];
|
||||
[buf appendString: @"<dt><b>Declared in:</b></dt>\n"];
|
||||
[buf appendString: indent];
|
||||
[buf appendString: @"<dd>"];
|
||||
[self outputText: [node children] to: buf];
|
||||
[buf appendString: @"</dd>\n"];
|
||||
[self decIndent];
|
||||
[buf appendString: indent];
|
||||
[buf appendString: @"</dl>\n"];
|
||||
[self decIndent];
|
||||
[buf appendString: indent];
|
||||
[buf appendString: @"</blockquote>\n"];
|
||||
node = [node next];
|
||||
}
|
||||
|
||||
if (node != nil && [[node name] isEqual: @"conform"] == YES)
|
||||
{
|
||||
[buf appendString: indent];
|
||||
[buf appendString: @"<blockquote>\n"];
|
||||
[self incIndent];
|
||||
[buf appendString: indent];
|
||||
[buf appendString: @"<dl>\n"];
|
||||
[self incIndent];
|
||||
[buf appendString: indent];
|
||||
[buf appendString: @"<dt><b>Conforms to:</b></dt>\n"];
|
||||
while (node != nil && [[node name] isEqual: @"conform"] == YES)
|
||||
{
|
||||
NSString *text = [[node children] content];
|
||||
|
||||
[buf appendString: indent];
|
||||
[buf appendString: @"<dd>"];
|
||||
[buf appendString: [self protocolRef: text]];
|
||||
[buf appendString: @"</dd>\n"];
|
||||
node = [node next];
|
||||
}
|
||||
[self decIndent];
|
||||
[buf appendString: indent];
|
||||
[buf appendString: @"</dl>\n"];
|
||||
[self decIndent];
|
||||
[buf appendString: indent];
|
||||
[buf appendString: @"</blockquote>\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: @"<h2>Methods</h2>\n"];
|
||||
[buf appendString: @"<hr width=\"50%\" align=\"left\" />\n"];
|
||||
[buf appendString: indent];
|
||||
[buf appendString: @"<h2>Method summary</h2>\n"];
|
||||
[buf appendString: indent];
|
||||
[buf appendString: @"<ul>\n"];
|
||||
[self incIndent];
|
||||
|
@ -1334,6 +1409,8 @@ NSLog(@"Element '%@' not implemented", name); // FIXME
|
|||
[self decIndent];
|
||||
[buf appendString: indent];
|
||||
[buf appendString: @"</ul>\n"];
|
||||
[buf appendString: indent];
|
||||
[buf appendString: @"<hr width=\"50%\" align=\"left\" />\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: @"<b>Standards:</b>"];
|
||||
while (tmp != nil)
|
||||
{
|
||||
[buf appendString: @" "];
|
||||
[buf appendString: [tmp name]];
|
||||
tmp = [tmp next];
|
||||
}
|
||||
[buf appendString: @"<br />\n"];
|
||||
}
|
||||
node = [node next];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -238,8 +238,10 @@
|
|||
on other files.
|
||||
</item>
|
||||
<item><strong>SourceDirectory</strong>
|
||||
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 <code>.h</code> files ... which are controlled
|
||||
by the HeaderDirectory default).<br />
|
||||
If this is not specified, sources are looked for relative to the
|
||||
current directory or using absolute path names if given.
|
||||
</item>
|
||||
<item><strong>SystemProjects</strong>
|
||||
|
@ -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?
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue