From eadaf467817b0ddd92f6e90d2f12d95eef8bb3be Mon Sep 17 00:00:00 2001 From: Riccardo Mottola Date: Mon, 12 Aug 2024 21:34:08 +0200 Subject: [PATCH 01/33] mark document as strict HTML4 and let's spot errors d- no HTML5 due to frames. --- Tools/AGSHtml.m | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/Tools/AGSHtml.m b/Tools/AGSHtml.m index 14e94851b..b6f5cbf92 100644 --- a/Tools/AGSHtml.m +++ b/Tools/AGSHtml.m @@ -432,11 +432,8 @@ - (NSString*) outputDocument: (GSXMLNode*)node name: (NSString*)file /* Declaration */ [buf appendString: @"\n"]; - [buf appendString: @"\n"]; + [buf appendString: @"\"-//W3C//DTD HTML 4.01//EN\"\n"]; + [buf appendString:@"\"http://www.w3.org/TR/html4/strict.dtd\">"]; [self incIndent]; [self outputNodeList: node to: buf]; From 1b823751e677e66072aef05e61bb604e3f17b8f3 Mon Sep 17 00:00:00 2001 From: Riccardo Mottola Date: Mon, 12 Aug 2024 21:57:21 +0200 Subject: [PATCH 02/33] use classic HTML non-closing tag syntax --- Tools/AGSHtml.m | 66 ++++++++++++++++++++++++------------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/Tools/AGSHtml.m b/Tools/AGSHtml.m index b6f5cbf92..6b2965e5d 100644 --- a/Tools/AGSHtml.m +++ b/Tools/AGSHtml.m @@ -261,7 +261,7 @@ - (id) init * Calls -makeLink:ofType:isRef: or -makeLink:ofType:inUnit:isRef: to * create the first part of an anchor, and fills in the text content * of the anchor with n (the specified name). Returns an entire anchor - * string as a result.
+ * string as a result.
* This method is used to create all the anchors in the html output. */ - (NSString*) makeAnchor: (NSString*)r @@ -336,9 +336,9 @@ - (NSString*) makeURL: (NSString*)r /** * Make a link for the element r, with the specified type t, * in a particular unit u. Only the start of - * the html element is returned (<a ...>).
+ * the html element is returned (<a ...>).
* If the boolean f is YES, then the link is a reference to somewhere, - * otherwise the link is an anchor for some element being output.
+ * otherwise the link is an anchor for some element being output.
* If there is an error, the method returns nil. */ - (NSString*) makeLink: (NSString*)r @@ -553,7 +553,7 @@ - (void) outputIndex: (NSString*)type } else { - [buf appendString: @"
"]; + [buf appendString: @"
"]; } [buf appendString: @"\n"]; } @@ -716,7 +716,7 @@ - (void) outputIndex: (NSString*)type } else { - [buf appendString: @"
"]; + [buf appendString: @"
"]; } [buf appendString: @"\n"]; @@ -762,7 +762,7 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf [self outputNodeList: children to: buf]; [buf appendString: indent]; - [buf appendString: @"
\n"]; + [buf appendString: @"
\n"]; if (prevFile != nil) { [buf appendString: indent]; @@ -791,7 +791,7 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf } else if ([name isEqual: @"br"] == YES) { - [buf appendString: @"
"]; + [buf appendString: @"
"]; } else if ([name isEqual: @"category"] == YES) { @@ -888,7 +888,7 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf [buf appendString: @"\n"]; [buf appendString: indent]; [buf appendString: str]; - [buf appendString: @";
\n"]; + [buf appendString: @";
\n"]; node = firstElement(children); @@ -925,7 +925,7 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf unsigned l = 0; [buf appendString: indent]; - [buf appendString: @"
\n"]; + [buf appendString: @"
\n"]; [buf appendString: indent]; [buf appendString: @"

Contents -

\n"]; @@ -1002,7 +1002,7 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf l--; } [buf appendString: indent]; - [buf appendString: @"
\n"]; + [buf appendString: @"
\n"]; } } else if ([name isEqual: @"declared"] == YES) @@ -1201,7 +1201,7 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf [buf appendString: @"\n"]; [buf appendString: indent]; [buf appendString: str]; - [buf appendString: @");
\n"]; + [buf appendString: @");
\n"]; node = firstElement(children); @@ -1314,7 +1314,7 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf if (prevFile != nil || upFile != nil || nextFile != nil) { [buf appendString: indent]; - [buf appendString: @"
\n"]; + [buf appendString: @"
\n"]; } [buf appendString: indent]; @@ -1535,7 +1535,7 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf { v = @"public"; } - [buf appendFormat: @"%@@%@ %@ %@;
\n", indent, v, t, n]; + [buf appendFormat: @"%@@%@ %@ %@;
\n", indent, v, t, n]; /* * List standards with which ivar complies @@ -1653,7 +1653,7 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf { [buf appendString: @")"]; } - [buf appendString: @"
\n"]; + [buf appendString: @"
\n"]; node = firstElement(children); @@ -1676,7 +1676,7 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf } [buf appendString: indent]; - [buf appendString: @"
\n"]; + [buf appendString: @"
\n"]; } else if ([name isEqual: @"method"] == YES) { @@ -1800,7 +1800,7 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf [buf appendString: @"\n"]; [buf appendString: indent]; [buf appendString: str]; - [buf appendString: @";
\n"]; + [buf appendString: @";
\n"]; node = firstElement(children); @@ -1818,23 +1818,23 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf && [str boolValue] == YES) { [buf appendString: @"This is a designated initialiser " - @"for the class.
\n"]; + @"for the class.
\n"]; } str = [prop objectForKey: @"override"]; if ([str isEqual: @"subclass"] == YES) { [buf appendString: @"Subclasses must " - @"override this method.
\n"]; + @"override this method.
\n"]; } else if ([str isEqual: @"dummy"] == YES) { [buf appendString: @"An empty method provided for subclasses " - @"to override.
\n"]; + @"to override.
\n"]; } else if ([str isEqual: @"never"] == YES) { [buf appendString: @"Subclasses must NOT " - @"override this method.
\n"]; + @"override this method.
\n"]; } if ([[node name] isEqual: @"desc"]) @@ -1842,7 +1842,7 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf [self outputNode: node to: buf]; } [buf appendString: indent]; - [buf appendString: @"
\n"]; + [buf appendString: @"
\n"]; } [buf appendString:@"\n"]; } @@ -2016,7 +2016,7 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf [buf appendString: @"\n"]; [buf appendString: indent]; [buf appendString: str]; - [buf appendString: @";
\n"]; + [buf appendString: @";
\n"]; node = firstElement(children); @@ -2039,7 +2039,7 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf } [buf appendString: indent]; - [buf appendString: @"
\n"]; + [buf appendString: @"
\n"]; } else if ([name isEqual: @"uref"] == YES) { @@ -2094,7 +2094,7 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf [buf appendString: @"\n"]; [buf appendString: indent]; [buf appendString: str]; - [buf appendString: @";
\n"]; + [buf appendString: @";
\n"]; node = firstElement(children); @@ -2117,7 +2117,7 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf } [buf appendString: indent]; - [buf appendString: @"
\n"]; + [buf appendString: @"
\n"]; } else { @@ -2663,16 +2663,16 @@ - (void) outputUnit: (GSXMLNode*)node to: (NSMutableString*)buf { ibuf = ivarBuf; [buf appendString: indent]; - [buf appendString: @"
\n"]; + [buf appendString: @"
\n"]; [buf appendString: indent]; [buf appendFormat: @"Instance Variables\n", classname]; [buf appendString: indent]; - [buf appendString: @"

\n"]; + [buf appendString: @"

\n"]; [ibuf appendFormat: @"", classname]; } [ibuf appendString: indent]; - [ibuf appendString: @"

\n"]; + [ibuf appendString: @"

\n"]; [ibuf appendString: indent]; [ibuf appendFormat: @"

Instance Variables for %@ Class

\n", classname]; @@ -2682,7 +2682,7 @@ - (void) outputUnit: (GSXMLNode*)node to: (NSMutableString*)buf node = [node nextElement]; } [ibuf appendString: indent]; - [ibuf appendString: @"


\n"]; + [ibuf appendString: @"


\n"]; } a = [localRefs methodsInUnit: unit]; @@ -2695,7 +2695,7 @@ - (void) outputUnit: (GSXMLNode*)node to: (NSMutableString*)buf target: nil to: buf]; [buf appendString: indent]; - [buf appendString: @"
\n"]; + [buf appendString: @"
\n"]; while (node != nil) { if ([[node name] isEqual: @"method"] == YES) @@ -2820,7 +2820,7 @@ - (void) outputVersion: (NSDictionary*)prop to: (NSMutableString*)buf } } [buf appendString:@"\n"]; - [buf appendString: @"
\n"]; + [buf appendString: @"
\n"]; } else if ([gvadd length] > 0) { @@ -2838,14 +2838,14 @@ - (void) outputVersion: (NSDictionary*)prop to: (NSMutableString*)buf [buf appendString: @" deprecated at "]; [buf appendString: gvdep]; } - [buf appendString: @"
\n"]; + [buf appendString: @"
\n"]; if ([gvrem length] > 0) { [buf appendString: @" Likely to be changed/moved/removed at "]; [buf appendString: gvrem]; } [buf appendString:@"\n"]; - [buf appendString: @"
\n"]; + [buf appendString: @"
\n"]; } } From 8792f56ebd5d3a1f9c499e890119182650589759 Mon Sep 17 00:00:00 2001 From: Riccardo Mottola Date: Thu, 22 Aug 2024 14:20:16 +0200 Subject: [PATCH 03/33] fix missing html tag start --- Tools/AGSHtml.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Tools/AGSHtml.m b/Tools/AGSHtml.m index 6b2965e5d..62c168d2f 100644 --- a/Tools/AGSHtml.m +++ b/Tools/AGSHtml.m @@ -433,7 +433,8 @@ - (NSString*) outputDocument: (GSXMLNode*)node name: (NSString*)file /* Declaration */ [buf appendString: @""]; + [buf appendString:@"\"http://www.w3.org/TR/html4/strict.dtd\">\n"]; + [buf appendString: @""]; // if we support multi-lang doc, this should be dynamic [self incIndent]; [self outputNodeList: node to: buf]; From 550facb17fd9eebff3c3500aa6a6dacf0bdc0295 Mon Sep 17 00:00:00 2001 From: Riccardo Mottola Date: Thu, 22 Aug 2024 14:26:08 +0200 Subject: [PATCH 04/33] use modern doctype suggested, or FF 115 uses quirks mode with classic html 4.01. See https://developer.mozilla.org/en-US/docs/Web/HTML/Quirks_Mode_and_Standards_Mode?utm_source=mozilla&utm_medium=firefox-console-errors&utm_campaign=default --- Tools/AGSHtml.m | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Tools/AGSHtml.m b/Tools/AGSHtml.m index 62c168d2f..06c260705 100644 --- a/Tools/AGSHtml.m +++ b/Tools/AGSHtml.m @@ -431,9 +431,7 @@ - (NSString*) outputDocument: (GSXMLNode*)node name: (NSString*)file buf = [NSMutableString stringWithCapacity: 4096]; /* Declaration */ - [buf appendString: @"\n"]; + [buf appendString: @"\n"]; [buf appendString: @""]; // if we support multi-lang doc, this should be dynamic [self incIndent]; From c8e2d51c8c78a16cfb87143abc784e45ba1cb192 Mon Sep 17 00:00:00 2001 From: Riccardo Mottola Date: Thu, 22 Aug 2024 14:32:39 +0200 Subject: [PATCH 05/33] declare charset static to utf-8 --- Tools/AGSHtml.m | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Tools/AGSHtml.m b/Tools/AGSHtml.m index 06c260705..ebc95a8a6 100644 --- a/Tools/AGSHtml.m +++ b/Tools/AGSHtml.m @@ -1259,6 +1259,11 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf [buf appendString: indent]; [buf appendString: @"\n"]; [self incIndent]; + + /** charset/encoding should be in first 1024 bytes, so before title */ + [buf appendString: indent]; + [buf appendString: @"\n"]; + children = firstElement(children); [buf appendString: indent]; [buf appendString: @""]; From 11dfe4d330cf5bff1c874771f1b3d2570d550417 Mon Sep 17 00:00:00 2001 From: rfm <richardfrithmacdonald@gmail.com> Date: Thu, 22 Aug 2024 19:32:45 +0100 Subject: [PATCH 06/33] Avoid output of the whitespace between elements within <gsdoc> --- Tools/AGSHtml.m | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/Tools/AGSHtml.m b/Tools/AGSHtml.m index 14e94851b..aa64a728f 100644 --- a/Tools/AGSHtml.m +++ b/Tools/AGSHtml.m @@ -447,6 +447,24 @@ - (NSString*) outputDocument: (GSXMLNode*)node name: (NSString*)file return buf; } +/** Output all the nodes containing xml elements from this one onwards. + * Text and entity ref nodes are ignored (to remove whitespace etc + * between elements). + */ +- (void) outputElemList: (GSXMLNode*)node to: (NSMutableString*)buf +{ + while (node != nil) + { + GSXMLNode *next = [node nextElement]; + + if ([node type] == XML_ELEMENT_NODE) + { + [self outputNode: node to: buf]; + } + node = next; + } +} + - (void) outputIndex: (NSString*)type scope: (NSString*)scope title: (NSString*)title @@ -1253,7 +1271,7 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf ([stylesheetURL rangeOfString: @"gsdoc_contents"].length > 0)) ? YES : NO; - [self outputNodeList: children to: buf]; + [self outputElemList: children to: buf]; } } else if ([name isEqual: @"head"] == YES) @@ -2138,8 +2156,7 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf LEAVE_POOL } -/** - * Output all the nodes from this one onwards ... try to output +/** Output all the nodes from this one onwards ... try to output * as text first, if not possible, call the main method to output * each node. */ From 0905c3059acec58980485eae9995e0bb51ea06fc Mon Sep 17 00:00:00 2001 From: Riccardo Mottola <rm@gnu.org> Date: Sat, 24 Aug 2024 14:49:31 +0200 Subject: [PATCH 07/33] add missing newline and remove comment, there is no multi-lang doc support --- Tools/AGSHtml.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/AGSHtml.m b/Tools/AGSHtml.m index 8bd9123c3..e75f567f6 100644 --- a/Tools/AGSHtml.m +++ b/Tools/AGSHtml.m @@ -432,7 +432,7 @@ - (NSString*) outputDocument: (GSXMLNode*)node name: (NSString*)file /* Declaration */ [buf appendString: @"<!DOCTYPE html>\n"]; - [buf appendString: @"<html lang=\"en\">"]; // if we support multi-lang doc, this should be dynamic + [buf appendString: @"<html lang=\"en\">\n"]; [self incIndent]; [self outputNodeList: node to: buf]; From 21f2cd0389aad378c52be0afa130ef4dd219f821 Mon Sep 17 00:00:00 2001 From: Riccardo Mottola <rm@gnu.org> Date: Sat, 24 Aug 2024 14:58:29 +0200 Subject: [PATCH 08/33] add declaration do avoid warning --- Tools/AGSHtml.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Tools/AGSHtml.h b/Tools/AGSHtml.h index b89e276e0..c23dd585a 100644 --- a/Tools/AGSHtml.h +++ b/Tools/AGSHtml.h @@ -61,6 +61,9 @@ - (NSString*) makeLink: (NSString*)r ofType: (NSString*)t isRef: (BOOL)f; +- (NSString*) makeURL: (NSString*)r + ofType: (NSString*)t + isRef: (BOOL)f; - (NSString*) makeLink: (NSString*)r ofType: (NSString*)t inUnit: (NSString*)u From 0619a30840e360ed19cc1cf182250a3bcdd09630 Mon Sep 17 00:00:00 2001 From: Riccardo Mottola <rm@gnu.org> Date: Tue, 27 Aug 2024 12:48:37 +0200 Subject: [PATCH 09/33] proper doctype and header also for frame indices --- Tools/autogsdoc.m | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Tools/autogsdoc.m b/Tools/autogsdoc.m index a8271e7bb..954b39b9f 100644 --- a/Tools/autogsdoc.m +++ b/Tools/autogsdoc.m @@ -1977,14 +1977,20 @@ standard PropertyList format (not the XML format of OS X), using // file for top-left frame (header only; rest appended below) idxIndexFile = [@"MainIndex" stringByAppendingPathExtension: @"html"]; - [idxIndex setString: @"<HTML>\n <BODY>\n" -@" <B>Index</B><BR/>\n"]; + [idxIndex setString: @"<!DOCTYPE HTML>\n" +@"<HTML>\n" +@" <HEAD>\n" +@" <META charset=\"utf-8\">\n" +@" </HEAD>\n" +@" <BODY>\n" +@" <B>Index</B><BR>\n"]; // this becomes index.html framesetFile = [@"index" stringByAppendingPathExtension: @"html"]; - [frameset setString: @"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"\"http://www.w3.org/TR/REC-html40/loose.dtd\">\n" -@"<HTML>\n" + [frameset setString: @"<!DOCTYPE HTML>\n" +@"<HTML lang=\"en\">\n" @" <HEAD>\n" +@" <META charset=\"utf-8\">\n" @" <TITLE>\n" @" Autogsdoc-generated Documentation for [prjName]\n" @" \n" From 2c8528d9730bfb0a94bca26eda3bb126c98c46ec Mon Sep 17 00:00:00 2001 From: rfm Date: Mon, 2 Sep 2024 21:52:02 +0100 Subject: [PATCH 10/33] Fix bug adding extra quotes --- Tools/AGSOutput.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/AGSOutput.m b/Tools/AGSOutput.m index 560399bbd..1e79886a5 100644 --- a/Tools/AGSOutput.m +++ b/Tools/AGSOutput.m @@ -2383,7 +2383,7 @@ - (NSString*) mergeMarkup: (NSString*)markup */ if (up != nil && [up isEqual: [name lastPathComponent]] == NO) { - [str appendString: @"\" up=\""]; + [str appendString: @" up=\""]; [str appendString: up]; [str appendString: @"\""]; } From db0d5a15e75caf074eca89ae410c31117d9b80b3 Mon Sep 17 00:00:00 2001 From: rfm Date: Tue, 3 Sep 2024 09:11:23 +0100 Subject: [PATCH 11/33] Create (and use if no -StylesheetURL is given) a default stylesheet, by copying an existing resource. --- Tools/AGSHtml.m | 16 ++++++--------- Tools/AGSOutput.m | 42 ++++++++++++++++++++++++++-------------- Tools/GNUmakefile | 4 ++++ Tools/autogsdoc.m | 4 +++- Tools/default-styles.css | 0 5 files changed, 41 insertions(+), 25 deletions(-) create mode 100644 Tools/default-styles.css diff --git a/Tools/AGSHtml.m b/Tools/AGSHtml.m index e75f567f6..89ddb7c3d 100644 --- a/Tools/AGSHtml.m +++ b/Tools/AGSHtml.m @@ -1290,17 +1290,13 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf [self decIndent]; [buf appendString: @"\n"]; - /** handcrafted styles for previous in-line styles */ - [buf appendString: indent]; - [buf appendString: @"\n"]; + [buf appendString: @"\n"]; + [buf appendFormat: @"\n", + [[NSUserDefaults standardUserDefaults] stringForKey: + @"StylesheetURL"]]; #if 0 - /** Css : TODO print.css **/ - [buf appendString:@"\n"]; - [buf appendString:@"\n"]; /** Robots **/ [buf appendString:@"\n"]; #endif diff --git a/Tools/AGSOutput.m b/Tools/AGSOutput.m index 1e79886a5..940530798 100644 --- a/Tools/AGSOutput.m +++ b/Tools/AGSOutput.m @@ -24,6 +24,7 @@ #import "Foundation/NSArray.h" #import "Foundation/NSAutoreleasePool.h" +#import "Foundation/NSBundle.h" #import "Foundation/NSCharacterSet.h" #import "Foundation/NSData.h" #import "Foundation/NSDictionary.h" @@ -301,6 +302,7 @@ - (id) init */ - (NSArray*) output: (NSMutableDictionary*)d { + NSFileManager *mgr = [NSFileManager defaultManager]; NSMutableString *str = [NSMutableString stringWithCapacity: 10240]; NSDictionary *classes; NSDictionary *categories; @@ -312,6 +314,7 @@ - (NSArray*) output: (NSMutableDictionary*)d NSDictionary *macros; NSMutableArray *files; NSArray *authors; + NSString *style = @"default-styles.css"; NSString *base; NSString *tmp; NSString *file; @@ -328,9 +331,25 @@ - (NSArray*) output: (NSMutableDictionary*)d file = [file stringByAppendingPathExtension: @"gsdoc"]; } dest = [info objectForKey: @"directory"]; - if ([dest length] > 0 && [file isAbsolutePath] == NO) + if ([dest length] > 0) { - file = [dest stringByAppendingPathComponent: file]; + style = [dest stringByAppendingPathComponent: style]; + if ([file isAbsolutePath] == NO) + { + file = [dest stringByAppendingPathComponent: file]; + } + } + + /* When there is no local default stylesheet present, we copy the + * stylesheet from the main bundle. + */ + if ([mgr isReadableFileAtPath: style] == NO) + { + NSBundle *bundle = [NSBundle mainBundle]; + NSString *path; + + path = [bundle pathForResource: @"default-styles" ofType: @"css"]; + [mgr copyPath: path toPath: style handler: nil]; } classes = [info objectForKey: @"Classes"]; @@ -361,12 +380,9 @@ - (NSArray*) output: (NSMutableDictionary*)d tmp = [[NSUserDefaults standardUserDefaults] stringForKey: @"StylesheetURL"]; } - if (tmp) - { - [str appendString: @" stylesheeturl=\""]; - [str appendString: tmp]; - [str appendString: @"\""]; - } + [str appendString: @" stylesheeturl=\""]; + [str appendString: tmp]; + [str appendString: @"\""]; tmp = [info objectForKey: @"up"]; if (tmp != nil) @@ -2370,12 +2386,10 @@ - (NSString*) mergeMarkup: (NSString*)markup tmp = [[NSUserDefaults standardUserDefaults] stringForKey: @"StylesheetURL"]; } - if (tmp) - { - [str appendString: @" stylesheeturl=\""]; - [str appendString: tmp]; - [str appendString: @"\""]; - } + [str appendString: @" stylesheeturl=\""]; + [str appendString: tmp]; + [str appendString: @"\""]; + /* * If a -Up default has been set, create an up link in this * template file... as long as the specified up link is not diff --git a/Tools/GNUmakefile b/Tools/GNUmakefile index 22a03f1df..ca54437e8 100644 --- a/Tools/GNUmakefile +++ b/Tools/GNUmakefile @@ -117,6 +117,10 @@ ifneq ($(HAVE_DOT), ) AGSHtml.m_FILE_FLAGS+= -DHAVE_DOT=$(HAVE_DOT) endif +autogsdoc_HAS_RESOURCE_BUNDLE = yes +autogsdoc_RESOURCE_FILES = \ + default-styles.css + # Reset this variable (defined in config.mak) to avoid useless linkage # against the libraries gnustep-base uses. CONFIG_SYSTEM_LIBS := diff --git a/Tools/autogsdoc.m b/Tools/autogsdoc.m index 954b39b9f..a89b82c6e 100644 --- a/Tools/autogsdoc.m +++ b/Tools/autogsdoc.m @@ -464,7 +464,8 @@ the project as dependencies of the project name (see StylesheetURL The URL of a CSS document to be used as the stadard stylesheet for - generated autogsdoc files. + generated autogsdoc files. If this is not specified the default of + a local document default-styles.css is used. SystemProjects This value is used to control the automatic inclusion of system @@ -751,6 +752,7 @@ standard PropertyList format (not the XML format of OS X), using defs = [NSUserDefaults standardUserDefaults]; [defs registerDefaults: [NSDictionary dictionaryWithObjectsAndKeys: @"Untitled", @"Project", + @"default-styles.css", @"StylesheetURL", nil]]; // BEGIN test for any unrecognized arguments, or "--help" diff --git a/Tools/default-styles.css b/Tools/default-styles.css new file mode 100644 index 000000000..e69de29bb From 7b70d77d2f9d7dfa6b8ccb351b0079a4e05c1b55 Mon Sep 17 00:00:00 2001 From: rfm Date: Tue, 3 Sep 2024 11:28:58 +0100 Subject: [PATCH 12/33] Fix error consuming extra character at end of .. --- Tools/AGSParser.m | 1 + 1 file changed, 1 insertion(+) diff --git a/Tools/AGSParser.m b/Tools/AGSParser.m index 0dc674b79..8a051f796 100644 --- a/Tools/AGSParser.m +++ b/Tools/AGSParser.m @@ -1345,6 +1345,7 @@ - (unsigned) parseComment if (buffer[pos + 1] == '/') { [self skipRemainderOfLine]; + break; } else if (buffer[pos + 1] == '*') { From 110a32e6e0dd5768bebdb956672d53f18bd2d531 Mon Sep 17 00:00:00 2001 From: Riccardo Mottola Date: Tue, 3 Sep 2024 19:22:28 +0200 Subject: [PATCH 13/33] add styles, including debug --- Tools/default-styles.css | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/Tools/default-styles.css b/Tools/default-styles.css index e69de29bb..a9ca83d9c 100644 --- a/Tools/default-styles.css +++ b/Tools/default-styles.css @@ -0,0 +1,22 @@ +.content-bar { + background-color: #cccccc; + float: left; + position: fixed; + top: 0px; + left: 0px; + width: 20%; + height: 100%; + padding: 10px; + margin: 5px; +} + +.content-nav-box { + position: absolute; + top: 0px; left: 0px; height: 30%; width: 100%; + overflow: auto; background-color: yellow; +} + +hr.method-separator { + width:25%; + margin-left:0; +} From 80216e632841fc6e90aabf9a4a34a05eab0345c4 Mon Sep 17 00:00:00 2001 From: rfm Date: Mon, 16 Sep 2024 19:36:28 +0100 Subject: [PATCH 14/33] Don't override the default stylesheet --- Source/DocMakefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Source/DocMakefile b/Source/DocMakefile index f24ab3223..666001619 100644 --- a/Source/DocMakefile +++ b/Source/DocMakefile @@ -253,7 +253,6 @@ Base_AGSDOC_FLAGS = \ -ConstantsTemplate TypesAndConstants \ -FunctionsTemplate Functions \ -MacrosTemplate Functions \ - -StylesheetURL gnustepStyle \ -TypedefsTemplate TypesAndConstants \ -VariablesTemplate TypesAndConstants \ -WordMap '{\ From b34089b8b693ab1cfce53f82491ab8a5a403feba Mon Sep 17 00:00:00 2001 From: rfm Date: Mon, 16 Sep 2024 21:16:31 +0100 Subject: [PATCH 15/33] nav bar inital attempt --- Tools/AGSHtml.m | 120 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) diff --git a/Tools/AGSHtml.m b/Tools/AGSHtml.m index 89ddb7c3d..31244a41e 100644 --- a/Tools/AGSHtml.m +++ b/Tools/AGSHtml.m @@ -27,6 +27,8 @@ #import "GNUstepBase/NSString+GNUstepBase.h" #import "GNUstepBase/NSMutableString+GNUstepBase.h" +#define navcss 1 + /* * Define constants for use if we are built with apple Foundation */ @@ -510,6 +512,7 @@ - (void) outputIndex: (NSString*)type /* Put the index in a div with a class identifying its scope and type * so that CSS can be used to style it. */ + [buf appendString: indent]; [buf appendFormat: @"
\n", scope, type]; if ([type isEqual: @"title"] == YES) @@ -747,6 +750,7 @@ - (void) outputIndex: (NSString*)type } [buf appendString: @"\n"]; } + [buf appendString: indent]; [buf appendString: @"
\n"]; } @@ -800,6 +804,10 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf [buf appendString: indent]; [buf appendString: indent]; + if (navcss) + { + [buf appendString: @"\n"]; + } if (isContentsDoc) { [buf appendString: @"\n"]; @@ -1314,6 +1322,118 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf [buf appendString: @"
\n"]; } + if (navcss) + { + [buf appendString: indent]; + [buf appendString: @"
\n"]; + [buf appendString: indent]; + [buf appendString: @"
\n"]; + + [buf appendString: indent]; + [buf appendString: + @"Classes
\n"]; + [buf appendString: indent]; + [buf appendString: + @"Protocols
\n"]; + [buf appendString: indent]; + [buf appendString: + @"Constants
\n"]; + [buf appendString: indent]; + [buf appendString: + @"Functions
\n"]; + [buf appendString: indent]; + [buf appendString: + @"Macros
\n"]; + [buf appendString: indent]; + [buf appendString: + @"Types
\n"]; + [buf appendString: indent]; + [buf appendString: + @"Variables
\n"]; + + [buf appendString: indent]; + [buf appendString: @"
\n"]; // content-bar-top + + [buf appendString: indent]; + [buf appendString: @"
\n"]; + + [buf appendString: indent]; + [buf appendString: @"Classes\n"]; + [self outputIndex: @"class" + scope: @"project" + title: @"Project classes" + style: @"bare" + target: nil + to: buf]; + + [buf appendString: indent]; + [buf appendString: + @"Protocols\n"]; + [self outputIndex: @"protocol" + scope: @"project" + title: @"Project protocols" + style: @"bare" + target: nil + to: buf]; + + [buf appendString: indent]; + [buf appendString: + @"Constants\n"]; + [self outputIndex: @"constant" + scope: @"project" + title: @"Project constants" + style: @"bare" + target: nil + to: buf]; + + [buf appendString: indent]; + [buf appendString: + @"Functions\n"]; + [self outputIndex: @"function" + scope: @"project" + title: @"Project functions" + style: @"bare" + target: nil + to: buf]; + + [buf appendString: indent]; + [buf appendString: + @"Macros\n"]; + [self outputIndex: @"macro" + scope: @"project" + title: @"Project macros" + style: @"bare" + target: nil + to: buf]; + + [buf appendString: indent]; + [buf appendString: @"Types\n"]; + [self outputIndex: @"type" + scope: @"project" + title: @"Project types" + style: @"bare" + target: nil + to: buf]; + + [buf appendString: indent]; + [buf appendString: @"Variables\n"]; + [self outputIndex: @"variable" + scope: @"project" + title: @"Project variables" + style: @"bare" + target: nil + to: buf]; + + [buf appendString: indent]; + [buf appendString: @"
\n"]; // bar-bottom + + [buf appendString: indent]; + [buf appendString: @"
\n"]; // content-bar + + [buf appendString: indent]; + [buf appendString: @"
\n"]; + } + if (prevFile != nil) { [buf appendString: indent]; From e12633199453ae007cae9088c055338114520b75 Mon Sep 17 00:00:00 2001 From: Riccardo Mottola Date: Mon, 16 Sep 2024 22:29:57 +0200 Subject: [PATCH 16/33] improved styles --- Tools/default-styles.css | 42 ++++++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/Tools/default-styles.css b/Tools/default-styles.css index a9ca83d9c..5ce4389b8 100644 --- a/Tools/default-styles.css +++ b/Tools/default-styles.css @@ -1,19 +1,49 @@ .content-bar { - background-color: #cccccc; + background-color: green; float: left; position: fixed; top: 0px; left: 0px; width: 20%; height: 100%; - padding: 10px; - margin: 5px; } -.content-nav-box { +.content-bar-top { position: absolute; - top: 0px; left: 0px; height: 30%; width: 100%; - overflow: auto; background-color: yellow; + top: 0px; + left: 0px; + height: 30%; + width: 100%; + overflow: auto; + background-color: yellow; +} + +.content-bar-bottom { + position: absolute; + bottom: 0px; + left: 0px; + height:70%; + width: 100%; + overflow: auto; + background-color: red; +} + +.content-pane { + background-color: pink; + position: fixed; + top: 0px; + right: 0px; + width: 80%; + height: 100%; + overflow-y: auto; +} + +.content-body { + background-color: grey; + position: absolute; + top: 0px; + left: 0px; + padding-left: 10px; } hr.method-separator { From a2c9bfab5b9ac33fbb31fc814e978c1b745d52c9 Mon Sep 17 00:00:00 2001 From: Riccardo Mottola Date: Tue, 24 Sep 2024 00:53:47 +0200 Subject: [PATCH 17/33] remove debug colors, add separate body styles for each pane --- Tools/default-styles.css | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/Tools/default-styles.css b/Tools/default-styles.css index 5ce4389b8..bd844c3a7 100644 --- a/Tools/default-styles.css +++ b/Tools/default-styles.css @@ -1,5 +1,5 @@ .content-bar { - background-color: green; + background-color: ; float: left; position: fixed; top: 0px; @@ -15,7 +15,14 @@ height: 30%; width: 100%; overflow: auto; - background-color: yellow; +} + +.content-bar-top-body { + position: absolute; + top: 0px; + left: 0px; + padding-left: 10px; + padding-top: 10px; } .content-bar-bottom { @@ -25,11 +32,18 @@ height:70%; width: 100%; overflow: auto; - background-color: red; } +.content-bar-bottom-body { + position: absolute; + top: 0px; + left: 0px; + padding-left: 10px; + padding-top: 10px; +} + + .content-pane { - background-color: pink; position: fixed; top: 0px; right: 0px; @@ -38,8 +52,7 @@ overflow-y: auto; } -.content-body { - background-color: grey; +.content-pane-body { position: absolute; top: 0px; left: 0px; From fc23434727aecb20d7a14cae333c3bc9043f5353 Mon Sep 17 00:00:00 2001 From: Riccardo Mottola Date: Tue, 24 Sep 2024 00:54:32 +0200 Subject: [PATCH 18/33] output body divs, fix indenting --- Tools/AGSHtml.m | 43 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/Tools/AGSHtml.m b/Tools/AGSHtml.m index 31244a41e..fb79a5f35 100644 --- a/Tools/AGSHtml.m +++ b/Tools/AGSHtml.m @@ -514,6 +514,7 @@ - (void) outputIndex: (NSString*)type */ [buf appendString: indent]; [buf appendFormat: @"
\n", scope, type]; + [self incIndent]; if ([type isEqual: @"title"] == YES) { @@ -750,8 +751,10 @@ - (void) outputIndex: (NSString*)type } [buf appendString: @"\n"]; } + + [self decIndent]; [buf appendString: indent]; - [buf appendString: @"
\n"]; + [buf appendString: @"
\n"]; // nav-bar section } - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf @@ -801,17 +804,23 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf } [self decIndent]; - [buf appendString: indent]; - [buf appendString: indent]; if (navcss) { - [buf appendString: @"
\n"]; + [self decIndent]; + [buf appendString: indent]; + [buf appendString: @"\n"]; //content-pane-body + [self decIndent]; + [buf appendString: indent]; + [buf appendString: @"\n"]; //content-pane } if (isContentsDoc) { + [self decIndent]; + [buf appendString: indent]; [buf appendString: @"\n"]; } + [buf appendString: indent]; [buf appendString: @"\n"]; } else if ([name isEqual: @"br"] == YES) @@ -1320,14 +1329,22 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf { [buf appendString: indent]; [buf appendString: @"
\n"]; + [self incIndent]; } if (navcss) { [buf appendString: indent]; [buf appendString: @"
\n"]; + [self incIndent]; + [buf appendString: indent]; [buf appendString: @"
\n"]; + [self incIndent]; + + [buf appendString: indent]; + [buf appendString: @"
\n"]; + [self incIndent]; [buf appendString: indent]; [buf appendString: @@ -1351,11 +1368,20 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf [buf appendString: @"Variables
\n"]; + [self decIndent]; + [buf appendString: indent]; + [buf appendString: @"
\n"]; // content-bar-top-body + [self decIndent]; [buf appendString: indent]; [buf appendString: @"
\n"]; // content-bar-top [buf appendString: indent]; [buf appendString: @"
\n"]; + [self incIndent]; + + [buf appendString: indent]; + [buf appendString: @"
\n"]; + [self incIndent]; [buf appendString: indent]; [buf appendString: @"Classes\n"]; @@ -1424,14 +1450,23 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf target: nil to: buf]; + [self decIndent]; + [buf appendString: indent]; + [buf appendString: @"
\n"]; // bar-bottom-body + [self decIndent]; [buf appendString: indent]; [buf appendString: @"
\n"]; // bar-bottom + [self decIndent]; [buf appendString: indent]; [buf appendString: @"
\n"]; // content-bar [buf appendString: indent]; [buf appendString: @"
\n"]; + [self incIndent]; + [buf appendString: indent]; + [buf appendString: @"
\n"]; + [self incIndent]; } if (prevFile != nil) From 4a506cb048c8c80a025fcf01b62ebf22168db87a Mon Sep 17 00:00:00 2001 From: Riccardo Mottola Date: Fri, 18 Oct 2024 11:35:47 +0200 Subject: [PATCH 19/33] style also section horizontal rulers --- Tools/AGSHtml.m | 12 ++++++------ Tools/default-styles.css | 9 ++++++++- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Tools/AGSHtml.m b/Tools/AGSHtml.m index fb79a5f35..8a3e9c9b5 100644 --- a/Tools/AGSHtml.m +++ b/Tools/AGSHtml.m @@ -959,7 +959,7 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf unsigned l = 0; [buf appendString: indent]; - [buf appendString: @"
\n"]; + [buf appendString: @"
\n"]; [buf appendString: indent]; [buf appendString: @"

Contents -

\n"]; @@ -1036,7 +1036,7 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf l--; } [buf appendString: indent]; - [buf appendString: @"
\n"]; + [buf appendString: @"
\n"]; } } else if ([name isEqual: @"declared"] == YES) @@ -2835,7 +2835,7 @@ - (void) outputUnit: (GSXMLNode*)node to: (NSMutableString*)buf { ibuf = ivarBuf; [buf appendString: indent]; - [buf appendString: @"
\n"]; + [buf appendString: @"
\n"]; [buf appendString: indent]; [buf appendFormat: @"Instance Variables\n", classname]; @@ -2844,7 +2844,7 @@ - (void) outputUnit: (GSXMLNode*)node to: (NSMutableString*)buf [ibuf appendFormat: @"", classname]; } [ibuf appendString: indent]; - [ibuf appendString: @"

\n"]; + [ibuf appendString: @"

\n"]; [ibuf appendString: indent]; [ibuf appendFormat: @"

Instance Variables for %@ Class

\n", classname]; @@ -2854,7 +2854,7 @@ - (void) outputUnit: (GSXMLNode*)node to: (NSMutableString*)buf node = [node nextElement]; } [ibuf appendString: indent]; - [ibuf appendString: @"


\n"]; + [ibuf appendString: @"


\n"]; } a = [localRefs methodsInUnit: unit]; @@ -2867,7 +2867,7 @@ - (void) outputUnit: (GSXMLNode*)node to: (NSMutableString*)buf target: nil to: buf]; [buf appendString: indent]; - [buf appendString: @"
\n"]; + [buf appendString: @"
\n"]; while (node != nil) { if ([[node name] isEqual: @"method"] == YES) diff --git a/Tools/default-styles.css b/Tools/default-styles.css index bd844c3a7..4fe6d0dab 100644 --- a/Tools/default-styles.css +++ b/Tools/default-styles.css @@ -1,5 +1,4 @@ .content-bar { - background-color: ; float: left; position: fixed; top: 0px; @@ -59,7 +58,15 @@ padding-left: 10px; } +hr.section-separator { + width:50%; + margin-left:0; + text-align:left; +} + + hr.method-separator { width:25%; margin-left:0; + text-align:left; } From e14da974c7afcf53fb2bef362a81d058c96b9ba3 Mon Sep 17 00:00:00 2001 From: Riccardo Mottola Date: Fri, 18 Oct 2024 11:58:00 +0200 Subject: [PATCH 20/33] give some visual separation to index areas --- Tools/default-styles.css | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Tools/default-styles.css b/Tools/default-styles.css index 4fe6d0dab..378c3576c 100644 --- a/Tools/default-styles.css +++ b/Tools/default-styles.css @@ -5,6 +5,7 @@ left: 0px; width: 20%; height: 100%; + border-right: 1px solid grey; } .content-bar-top { @@ -14,6 +15,7 @@ height: 30%; width: 100%; overflow: auto; + border-bottom: 1px solid grey; } .content-bar-top-body { From bd6c52e8d470f990ed0f1396765860aa3458827d Mon Sep 17 00:00:00 2001 From: rfm Date: Mon, 21 Oct 2024 19:25:51 +0100 Subject: [PATCH 21/33] Add skipping of generics in a few more places. --- Tools/AGSParser.m | 74 ++++++++++++++++++++++++++++++----------------- 1 file changed, 47 insertions(+), 27 deletions(-) diff --git a/Tools/AGSParser.m b/Tools/AGSParser.m index 8a051f796..bce7821aa 100644 --- a/Tools/AGSParser.m +++ b/Tools/AGSParser.m @@ -1855,34 +1855,21 @@ - (NSMutableArray*) parseDeclarations */ if ([self parseSpace] < length && buffer[pos] == '<') { - unsigned save = pos; - NSString *p; + NSArray *protocols = [self parseProtocolList]; - do - { - pos++; - p = [self parseIdentifier]; - if (p != nil) - { - [a addObject: p]; - } - } - while ([self parseSpace] < length && buffer[pos] == ','); - if ('>' == buffer[pos]) - { - pos++; - [self parseSpace]; + if (protocols) + { + [a addObjectsFromArray: protocols]; [a sortUsingSelector: @selector(compare:)]; [t appendString: @"<"]; [t appendString: [a componentsJoinedByString: @","]]; [t appendString: @">"]; [a removeAllObjects]; - } - else - { - pos = save; - [self skipGeneric]; - } + } + else + { + [self skipGeneric]; + } } baseType = t; } @@ -2464,7 +2451,7 @@ - (NSMutableDictionary*) parseImplementation { pos++; if ((base = [self parseIdentifier]) == nil - || [self parseSpace] >= length) + || [self parseSpaceOrGeneric] >= length) { [self log: @"@interface with bad base class"]; goto fail; @@ -2561,7 +2548,7 @@ - (NSMutableDictionary*) parseInterface } if ((name = [self parseIdentifier]) == nil - || [self parseSpace] >= length) + || [self parseSpaceOrGeneric] >= length) { [self log: @"interface with bad name"]; goto fail; @@ -2626,7 +2613,17 @@ - (NSMutableDictionary*) parseInterface if (protocols == nil) { - goto fail; + unsigned saved = pos; + + if ([self skipGeneric] > saved) + { + [self parseSpace]; + } + else + { + [self log: @"bad protocol list"]; + goto fail; + } } else if ([protocols count] > 0) { @@ -4329,6 +4326,7 @@ - (NSMutableDictionary*) parseProtocol if (protocols == nil) { + [self log: @"bad protocol list"]; goto fail; } else if ([protocols count] > 0) @@ -4389,6 +4387,7 @@ - (NSMutableArray*) parseProtocolList { NSMutableArray *protocols; NSString *p; + unsigned start = pos; protocols = [NSMutableArray arrayWithCapacity: 2]; pos++; @@ -4411,7 +4410,7 @@ - (NSMutableArray*) parseProtocolList if (pos >= length || buffer[pos] != '>' || ++pos >= length || [self parseSpace] >= length || [protocols count] == 0) { - [self log: @"bad protocol list"]; + pos = start; return nil; } return protocols; @@ -4523,7 +4522,28 @@ - (unsigned) parseSpace: (NSCharacterSet*)spaceSet - (unsigned) parseSpace { - return [self parseSpace: spacenl]; + [self parseSpace: spacenl]; + return pos; +} + +- (unsigned) parseSpaceOrGeneric +{ + [self parseSpace: spacenl]; + + if (pos < length && '<' == buffer[pos]) + { + unsigned saved = pos; + + if ([self skipGeneric] > saved) + { + [self parseSpace]; + } + else + { + [self log: @"bad generic"]; + } + } + return pos; } - (NSString*) parseVersion From f162e0f97ed41369fafe9cc8e161cd42d1d4a725 Mon Sep 17 00:00:00 2001 From: rfm Date: Mon, 21 Oct 2024 20:55:21 +0100 Subject: [PATCH 22/33] Changes for index.html output --- Source/DocMakefile | 6 ++++-- Tools/AGSHtml.h | 1 + Tools/AGSHtml.m | 7 +++---- Tools/autogsdoc.m | 17 +++++++++++++++++ 4 files changed, 25 insertions(+), 6 deletions(-) diff --git a/Source/DocMakefile b/Source/DocMakefile index 666001619..81e27f666 100644 --- a/Source/DocMakefile +++ b/Source/DocMakefile @@ -244,7 +244,8 @@ GCObject.h \ # directory. # Base_AGSDOC_FLAGS = \ - -MakeFrames YES \ + -MakeFrames NO \ + -IndexFile Base \ -DocumentationDirectory ../Documentation/Base \ -HeaderDirectory ../Headers/Foundation \ -Declared Foundation \ @@ -259,7 +260,8 @@ Base_AGSDOC_FLAGS = \ }' -Up Base BaseAdditions_AGSDOC_FLAGS = \ - -MakeFrames YES \ + -MakeFrames NO \ + -IndexFile BaseAdditions \ -DocumentationDirectory ../Documentation/BaseAdditions \ -HeaderDirectory ../Headers/GNUstepBase \ -Declared GNUstepBase \ diff --git a/Tools/AGSHtml.h b/Tools/AGSHtml.h index c23dd585a..e8d9f9cff 100644 --- a/Tools/AGSHtml.h +++ b/Tools/AGSHtml.h @@ -50,6 +50,7 @@ unsigned sssect; BOOL isContentsDoc; BOOL ivarsAtEnd; + BOOL cssNavigation; BOOL verbose; BOOL warn; } diff --git a/Tools/AGSHtml.m b/Tools/AGSHtml.m index 8a3e9c9b5..ad2e6b9f3 100644 --- a/Tools/AGSHtml.m +++ b/Tools/AGSHtml.m @@ -27,8 +27,6 @@ #import "GNUstepBase/NSString+GNUstepBase.h" #import "GNUstepBase/NSMutableString+GNUstepBase.h" -#define navcss 1 - /* * Define constants for use if we are built with apple Foundation */ @@ -255,6 +253,7 @@ - (id) init project = RETAIN([defs stringForKey: @"Project"]); verbose = [defs boolForKey: @"Verbose"]; warn = [defs boolForKey: @"Warn"]; + cssNavigation = [defs boolForKey: @"MakeFrames"] ? NO : YES; } return self; } @@ -805,7 +804,7 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf [self decIndent]; - if (navcss) + if (cssNavigation) { [self decIndent]; [buf appendString: indent]; @@ -1332,7 +1331,7 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf [self incIndent]; } - if (navcss) + if (cssNavigation) { [buf appendString: indent]; [buf appendString: @"
\n"]; diff --git a/Tools/autogsdoc.m b/Tools/autogsdoc.m index a89b82c6e..b1ffba75b 100644 --- a/Tools/autogsdoc.m +++ b/Tools/autogsdoc.m @@ -813,6 +813,9 @@ standard PropertyList format (not the XML format of OS X), using @"FunctionsTemplate", @"\t\tSTR\t(\"\")\n\tfile into which docs for macros " @"should be consolidated", + @"IndexFile", + @"\t\tSTR\t(\"\")\n\tHTML file name (extension omitted) " + @"copied to index.html", @"MacrosTemplate", @"\t\tSTR\t(\"\")\n\tfile into which docs for typedefs " @"should be consolidated", @@ -2102,6 +2105,9 @@ standard PropertyList format (not the XML format of OS X), using count = [gFiles count]; if (generateHtml == YES && count > 0) { + NSString *htmlIndexFile; + + htmlIndexFile = [defs stringForKey: @"IndexFile"]; pool = [NSAutoreleasePool new]; for (i = 0; i < count; i++) @@ -2208,6 +2214,17 @@ standard PropertyList format (not the XML format of OS X), using { NSLog(@"Sorry unable to write %@", htmlfile); } + if ([file isEqual: htmlIndexFile]) + { + NSString *s; + + s = [documentationDirectory + stringByAppendingPathComponent: @"index.html"]; + if ([d writeToFile: s atomically: YES]) + { + NSLog(@"Sorry unable to write %@ to %s", htmlfile, s); + } + } } } else if ([arg hasSuffix: @".gsdoc"] == YES) From fce8393561117477c8ad67a05a31da33b27ff035 Mon Sep 17 00:00:00 2001 From: rfm Date: Mon, 21 Oct 2024 20:58:29 +0100 Subject: [PATCH 23/33] fix format error --- Tools/autogsdoc.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/autogsdoc.m b/Tools/autogsdoc.m index b1ffba75b..6d5b099dc 100644 --- a/Tools/autogsdoc.m +++ b/Tools/autogsdoc.m @@ -2222,7 +2222,7 @@ standard PropertyList format (not the XML format of OS X), using stringByAppendingPathComponent: @"index.html"]; if ([d writeToFile: s atomically: YES]) { - NSLog(@"Sorry unable to write %@ to %s", htmlfile, s); + NSLog(@"Sorry unable to write %@ to %@", htmlfile, s); } } } From c0cc6453bc922d3bad6e7531302844639ea6ee4e Mon Sep 17 00:00:00 2001 From: rfm Date: Mon, 21 Oct 2024 21:14:52 +0100 Subject: [PATCH 24/33] Add index section header info --- Tools/AGSHtml.m | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/Tools/AGSHtml.m b/Tools/AGSHtml.m index ad2e6b9f3..3e884ba11 100644 --- a/Tools/AGSHtml.m +++ b/Tools/AGSHtml.m @@ -1383,7 +1383,9 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf [self incIndent]; [buf appendString: indent]; - [buf appendString: @"Classes\n"]; + [buf appendString: @"

"]; + [buf appendString: @"Classes"]; + [buf appendString: @"

\n"]; [self outputIndex: @"class" scope: @"project" title: @"Project classes" @@ -1392,8 +1394,10 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf to: buf]; [buf appendString: indent]; + [buf appendString: @"

"]; [buf appendString: - @"Protocols\n"]; + @"Protocols"]; + [buf appendString: @"

\n"]; [self outputIndex: @"protocol" scope: @"project" title: @"Project protocols" @@ -1402,8 +1406,10 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf to: buf]; [buf appendString: indent]; + [buf appendString: @"

"]; [buf appendString: - @"Constants\n"]; + @"Constants"]; + [buf appendString: @"

\n"]; [self outputIndex: @"constant" scope: @"project" title: @"Project constants" @@ -1412,8 +1418,10 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf to: buf]; [buf appendString: indent]; + [buf appendString: @"

"]; [buf appendString: - @"Functions\n"]; + @"Functions"]; + [buf appendString: @"

\n"]; [self outputIndex: @"function" scope: @"project" title: @"Project functions" @@ -1422,8 +1430,10 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf to: buf]; [buf appendString: indent]; + [buf appendString: @"

"]; [buf appendString: - @"Macros\n"]; + @"Macros"]; + [buf appendString: @"

\n"]; [self outputIndex: @"macro" scope: @"project" title: @"Project macros" @@ -1432,7 +1442,9 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf to: buf]; [buf appendString: indent]; - [buf appendString: @"Types\n"]; + [buf appendString: @"

"]; + [buf appendString: @"Types"]; + [buf appendString: @"

\n"]; [self outputIndex: @"type" scope: @"project" title: @"Project types" @@ -1441,7 +1453,9 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf to: buf]; [buf appendString: indent]; - [buf appendString: @"Variables\n"]; + [buf appendString: @"

"]; + [buf appendString: @"Variables"]; + [buf appendString: @"

\n"]; [self outputIndex: @"variable" scope: @"project" title: @"Project variables" From 8456b7235db488e5a0ecd77436a5e30e2a2f70df Mon Sep 17 00:00:00 2001 From: rfm Date: Mon, 21 Oct 2024 21:18:10 +0100 Subject: [PATCH 25/33] Fix invert logic --- Tools/autogsdoc.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/autogsdoc.m b/Tools/autogsdoc.m index 6d5b099dc..360c63fd5 100644 --- a/Tools/autogsdoc.m +++ b/Tools/autogsdoc.m @@ -2220,7 +2220,7 @@ standard PropertyList format (not the XML format of OS X), using s = [documentationDirectory stringByAppendingPathComponent: @"index.html"]; - if ([d writeToFile: s atomically: YES]) + if ([d writeToFile: s atomically: YES] == NO) { NSLog(@"Sorry unable to write %@ to %@", htmlfile, s); } From c122aa6d193aca185162f9f83bfcdb4e34462e0a Mon Sep 17 00:00:00 2001 From: rfm Date: Mon, 21 Oct 2024 21:50:12 +0100 Subject: [PATCH 26/33] Styling for indexes --- Tools/AGSHtml.m | 55 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 39 insertions(+), 16 deletions(-) diff --git a/Tools/AGSHtml.m b/Tools/AGSHtml.m index 3e884ba11..43eafd3e5 100644 --- a/Tools/AGSHtml.m +++ b/Tools/AGSHtml.m @@ -474,7 +474,16 @@ - (void) outputIndex: (NSString*)type NSArray *a; unsigned c; unsigned i; - BOOL isBareStyle = [@"bare" isEqualToString: style]; + BOOL isBareStyle = NO; + + if ([@"bare" isEqualToString: style]) + { + isBareStyle = YES; + } + else if ([@"cssNavigation" isEqualToString: style]) + { + isBareStyle = YES; + } if (globalRefs != nil && [scope isEqual: @"global"] == YES) { @@ -514,6 +523,12 @@ - (void) outputIndex: (NSString*)type [buf appendString: indent]; [buf appendFormat: @"
\n", scope, type]; [self incIndent]; + if ([@"cssNavigation" isEqualToString: style]) + { + [buf appendString: indent]; + [buf appendString: @"

\n"]; + [self incIndent]; + } if ([type isEqual: @"title"] == YES) { @@ -522,7 +537,9 @@ - (void) outputIndex: (NSString*)type if (!isBareStyle) { [buf appendString: indent]; - [buf appendFormat: @"%@ Index\n", title]; + [buf appendFormat: + @"

%@ Index

\n", + title]; [buf appendString: indent]; [buf appendString: @"
    \n"]; [self incIndent]; @@ -751,6 +768,12 @@ - (void) outputIndex: (NSString*)type [buf appendString: @"\n"]; } + if ([@"cssNavigation" isEqualToString: style]) + { + [self decIndent]; + [buf appendString: indent]; + [buf appendString: @"

    \n"]; + } [self decIndent]; [buf appendString: indent]; [buf appendString: @"
\n"]; // nav-bar section @@ -1383,83 +1406,83 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf [self incIndent]; [buf appendString: indent]; - [buf appendString: @"

"]; + [buf appendString: @"

"]; [buf appendString: @"Classes"]; [buf appendString: @"

\n"]; [self outputIndex: @"class" scope: @"project" title: @"Project classes" - style: @"bare" + style: @"cssNavigation" target: nil to: buf]; [buf appendString: indent]; - [buf appendString: @"

"]; + [buf appendString: @"

"]; [buf appendString: @"Protocols"]; [buf appendString: @"

\n"]; [self outputIndex: @"protocol" scope: @"project" title: @"Project protocols" - style: @"bare" + style: @"cssNavigation" target: nil to: buf]; [buf appendString: indent]; - [buf appendString: @"

"]; + [buf appendString: @"

"]; [buf appendString: @"Constants"]; [buf appendString: @"

\n"]; [self outputIndex: @"constant" scope: @"project" title: @"Project constants" - style: @"bare" + style: @"cssNavigation" target: nil to: buf]; [buf appendString: indent]; - [buf appendString: @"

"]; + [buf appendString: @"

"]; [buf appendString: @"Functions"]; [buf appendString: @"

\n"]; [self outputIndex: @"function" scope: @"project" title: @"Project functions" - style: @"bare" + style: @"cssNavigation" target: nil to: buf]; [buf appendString: indent]; - [buf appendString: @"

"]; + [buf appendString: @"

"]; [buf appendString: @"Macros"]; [buf appendString: @"

\n"]; [self outputIndex: @"macro" scope: @"project" title: @"Project macros" - style: @"bare" + style: @"cssNavigation" target: nil to: buf]; [buf appendString: indent]; - [buf appendString: @"

"]; + [buf appendString: @"

"]; [buf appendString: @"Types"]; [buf appendString: @"

\n"]; [self outputIndex: @"type" scope: @"project" title: @"Project types" - style: @"bare" + style: @"cssNavigation" target: nil to: buf]; [buf appendString: indent]; - [buf appendString: @"

"]; + [buf appendString: @"

"]; [buf appendString: @"Variables"]; [buf appendString: @"

\n"]; [self outputIndex: @"variable" scope: @"project" title: @"Project variables" - style: @"bare" + style: @"cssNavigation" target: nil to: buf]; From 9097de9fbcb47c669edbf2c11d8c690c737482b9 Mon Sep 17 00:00:00 2001 From: rfm Date: Mon, 21 Oct 2024 22:12:24 +0100 Subject: [PATCH 27/33] If we have an incorrect flag, say what it was. --- Tools/autogsdoc.m | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Tools/autogsdoc.m b/Tools/autogsdoc.m index 360c63fd5..0fc49320d 100644 --- a/Tools/autogsdoc.m +++ b/Tools/autogsdoc.m @@ -853,6 +853,10 @@ standard PropertyList format (not the XML format of OS X), using { NSArray *args = [argsRecognized allKeys]; + if (![@"help" isEqual: opt]) + { + GSPrintf(stderr, @"Unknown option:\ '%@'\n", opt); + } GSPrintf(stderr, @"Usage:\n"); GSPrintf(stderr, [NSString stringWithFormat: @" %@ [options] [files]\n", [argsGiven objectAtIndex: 0]]); From 964cd4e5c55f8894d655de1fac6a354bcd2ba185 Mon Sep 17 00:00:00 2001 From: rfm Date: Mon, 21 Oct 2024 22:13:34 +0100 Subject: [PATCH 28/33] Tidied classes for indexes --- Tools/AGSHtml.m | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/Tools/AGSHtml.m b/Tools/AGSHtml.m index 43eafd3e5..2b192808f 100644 --- a/Tools/AGSHtml.m +++ b/Tools/AGSHtml.m @@ -521,14 +521,8 @@ - (void) outputIndex: (NSString*)type * so that CSS can be used to style it. */ [buf appendString: indent]; - [buf appendFormat: @"
\n", scope, type]; + [buf appendFormat: @"

\n", scope, type]; [self incIndent]; - if ([@"cssNavigation" isEqualToString: style]) - { - [buf appendString: indent]; - [buf appendString: @"

\n"]; - [self incIndent]; - } if ([type isEqual: @"title"] == YES) { @@ -670,7 +664,8 @@ - (void) outputIndex: (NSString*)type [buf appendString: indent]; if (!isBareStyle) { - [buf appendFormat: @"%@\n", title]; + [buf appendFormat: + @"

%@

\n", title]; } [buf appendString: indent]; if (!isBareStyle) @@ -768,15 +763,9 @@ - (void) outputIndex: (NSString*)type [buf appendString: @"\n"]; } - if ([@"cssNavigation" isEqualToString: style]) - { - [self decIndent]; - [buf appendString: indent]; - [buf appendString: @"

\n"]; - } [self decIndent]; [buf appendString: indent]; - [buf appendString: @"
\n"]; // nav-bar section + [buf appendString: @"

\n"]; } - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf From 15270e460bc4f20cd4cd782197da7716e7461ee0 Mon Sep 17 00:00:00 2001 From: rfm Date: Mon, 21 Oct 2024 22:16:11 +0100 Subject: [PATCH 29/33] fix typo --- Tools/autogsdoc.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/autogsdoc.m b/Tools/autogsdoc.m index 0fc49320d..edbe27510 100644 --- a/Tools/autogsdoc.m +++ b/Tools/autogsdoc.m @@ -855,7 +855,7 @@ standard PropertyList format (not the XML format of OS X), using if (![@"help" isEqual: opt]) { - GSPrintf(stderr, @"Unknown option:\ '%@'\n", opt); + GSPrintf(stderr, @"Unknown option: '%@'\n", opt); } GSPrintf(stderr, @"Usage:\n"); GSPrintf(stderr, [NSString stringWithFormat: From a8337b7f66b91ee2da8faffb6114e9acc16b535a Mon Sep 17 00:00:00 2001 From: rfm Date: Mon, 4 Nov 2024 21:22:36 +0000 Subject: [PATCH 30/33] Add "node figure" class for svg --- Tools/AGSHtml.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/AGSHtml.m b/Tools/AGSHtml.m index 2b192808f..55ccddeec 100644 --- a/Tools/AGSHtml.m +++ b/Tools/AGSHtml.m @@ -2740,7 +2740,7 @@ - (void) outputUnit: (GSXMLNode*)node to: (NSMutableString*)buf [dot appendFormat: @"digraph class_%@ {\n", cNam]; [dot appendString: @" rankdir = \"TB\";\n"]; [dot appendString: @" {\n"]; - [dot appendString: @" node [margin=0 fontcolor=blue" + [dot appendString: @" node [class=figure margin=0 fontcolor=blue" @" fontsize=24 width=0.5 shape=rectangle style=filled]\n"]; if (sNam) { From e9d1e9ebbc4e7781e964cdf247b11668414b9112 Mon Sep 17 00:00:00 2001 From: rfm Date: Mon, 4 Nov 2024 21:39:01 +0000 Subject: [PATCH 31/33] revert faulty class change --- Tools/AGSHtml.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tools/AGSHtml.m b/Tools/AGSHtml.m index 55ccddeec..2b192808f 100644 --- a/Tools/AGSHtml.m +++ b/Tools/AGSHtml.m @@ -2740,7 +2740,7 @@ - (void) outputUnit: (GSXMLNode*)node to: (NSMutableString*)buf [dot appendFormat: @"digraph class_%@ {\n", cNam]; [dot appendString: @" rankdir = \"TB\";\n"]; [dot appendString: @" {\n"]; - [dot appendString: @" node [class=figure margin=0 fontcolor=blue" + [dot appendString: @" node [margin=0 fontcolor=blue" @" fontsize=24 width=0.5 shape=rectangle style=filled]\n"]; if (sNam) { From 8382e02a16c8c0c2f4ce0d547ca72a41c00cccd4 Mon Sep 17 00:00:00 2001 From: rfm Date: Mon, 4 Nov 2024 22:13:28 +0000 Subject: [PATCH 32/33] Add css classes for nodes in the diagrams as follows: figure_super if the element is the superclass of the ne being documented figure_class if the element is for a non-root class figure_root if the element is for a root class figure_protocol if the element is for a protocol --- Tools/AGSHtml.m | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Tools/AGSHtml.m b/Tools/AGSHtml.m index 2b192808f..f3294c697 100644 --- a/Tools/AGSHtml.m +++ b/Tools/AGSHtml.m @@ -2744,27 +2744,28 @@ - (void) outputUnit: (GSXMLNode*)node to: (NSMutableString*)buf @" fontsize=24 width=0.5 shape=rectangle style=filled]\n"]; if (sNam) { + [dot appendFormat: @" %@ [class=figure_super", sNam]; if (url) { - [dot appendFormat: @" %@ [URL=\"%@\"]\n", sNam, url]; - } - else - { - [dot appendFormat: @" %@\n", sNam]; + [dot appendFormat: @" URL=\"%@\"", url]; } + [dot appendString: @"]\n"]; + [dot appendFormat: @" %@ [class=figure_class fontcolor=\"green\"]\n", + cNam]; } else { sNam = cNam; // This is a root class ... + [dot appendFormat: @" %@ [class=figure_root fontcolor=\"green\"]\n", + cNam]; } - [dot appendFormat: @" %@ [fontcolor=\"green\"]\n", cNam]; if (protocols) { e = [protocols keyEnumerator]; while ((p = [e nextObject]) != nil) { - [dot appendFormat: - @" p_%@ [label=\"%@\" URL=\"%@\" shape=hexagon]\n", + [dot appendFormat: @" p_%@ [class=figure_protocol" + @" label=\"%@\" URL=\"%@\" shape=hexagon]\n", p, p, [protocols objectForKey: p]]; } } From 74f70e88997fb1cc52fc7c010fee67c320fd07d8 Mon Sep 17 00:00:00 2001 From: Riccardo Mottola Date: Tue, 5 Nov 2024 01:04:52 +0100 Subject: [PATCH 33/33] fix style formatting, cleanup and make description style working --- Tools/default-styles.css | 96 +++++++++++++++++++++++----------------- 1 file changed, 56 insertions(+), 40 deletions(-) diff --git a/Tools/default-styles.css b/Tools/default-styles.css index 378c3576c..4fb24f262 100644 --- a/Tools/default-styles.css +++ b/Tools/default-styles.css @@ -1,63 +1,63 @@ .content-bar { - float: left; - position: fixed; - top: 0px; - left: 0px; - width: 20%; - height: 100%; - border-right: 1px solid grey; + float: left; + position: fixed; + top: 0px; + left: 0px; + width: 20%; + height: 100%; + border-right: 1px solid grey; } .content-bar-top { - position: absolute; - top: 0px; - left: 0px; - height: 30%; - width: 100%; - overflow: auto; - border-bottom: 1px solid grey; + position: absolute; + top: 0px; + left: 0px; + height: 30%; + width: 100%; + overflow: auto; + border-bottom: 1px solid grey; } .content-bar-top-body { - position: absolute; - top: 0px; - left: 0px; - padding-left: 10px; - padding-top: 10px; + position: absolute; + top: 0px; + left: 0px; + padding-left: 10px; + padding-top: 10px; } .content-bar-bottom { - position: absolute; - bottom: 0px; - left: 0px; - height:70%; - width: 100%; - overflow: auto; + position: absolute; + bottom: 0px; + left: 0px; + height:70%; + width: 100%; + overflow: auto; } .content-bar-bottom-body { - position: absolute; - top: 0px; - left: 0px; - padding-left: 10px; - padding-top: 10px; + position: absolute; + top: 0px; + left: 0px; + padding-left: 10px; + padding-top: 10px; } .content-pane { - position: fixed; - top: 0px; - right: 0px; - width: 80%; - height: 100%; - overflow-y: auto; + position: fixed; + top: 0px; + right: 0px; + width: 80%; + height: 100%; + overflow-y: auto; } .content-pane-body { - position: absolute; - top: 0px; - left: 0px; - padding-left: 10px; + position: absolute; + top: 0px; + left: 0px; + padding-left: 10px; } hr.section-separator { @@ -72,3 +72,19 @@ hr.method-separator { margin-left:0; text-align:left; } + +h3.content-bar-index-section-header { + font-family: sans-serif; +} + +h3.index-section-header { + font-family: sans-serif; +} + +p { + font-family: Serif; +} + +.desc { + font-family: Serif; +}