mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
Added partially written gsdoc-html converter
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@11175 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
775258cd6b
commit
995473179c
9 changed files with 1353 additions and 9 deletions
53
Tools/AGSHtml.h
Normal file
53
Tools/AGSHtml.h
Normal file
|
@ -0,0 +1,53 @@
|
||||||
|
#ifndef _INCLUDED_AGSHTML_H
|
||||||
|
#define _INCLUDED_AGSHTML_H
|
||||||
|
/**
|
||||||
|
|
||||||
|
<title>AGSHtml ... a class to output html for a gsdoc file</title>
|
||||||
|
Copyright <copy>(C) 2001 Free Software Foundation, Inc.</copy>
|
||||||
|
|
||||||
|
Written by: <author name="Richard Frith-Macdonald">
|
||||||
|
<email>richard@brainstorm.co.uk</email></author>
|
||||||
|
Created: October 2001
|
||||||
|
|
||||||
|
This file is part of the GNUstep Project
|
||||||
|
|
||||||
|
This library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU General Public License
|
||||||
|
as published by the Free Software Foundation; either version 2
|
||||||
|
of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public
|
||||||
|
License along with this library; see the file COPYING.LIB.
|
||||||
|
If not, write to the Free Software Foundation,
|
||||||
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "AGSIndex.h"
|
||||||
|
|
||||||
|
@interface AGSHtml : NSObject
|
||||||
|
{
|
||||||
|
AGSIndex *localRefs;
|
||||||
|
AGSIndex *globalRefs;
|
||||||
|
NSMutableString *indent;
|
||||||
|
NSString *base; // Not retained
|
||||||
|
NSString *unit; // Not retained
|
||||||
|
NSString *heading; // Not retained
|
||||||
|
NSString *nextFile; // Not retained
|
||||||
|
NSString *prevFile; // Not retained
|
||||||
|
NSString *upFile; // Not retained
|
||||||
|
}
|
||||||
|
- (void) decIndent;
|
||||||
|
- (void) incIndent;
|
||||||
|
- (NSString*) outputDocument: (GSXMLNode*)node;
|
||||||
|
- (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf;
|
||||||
|
- (GSXMLNode*) outputBlock: (GSXMLNode*)node
|
||||||
|
to: (NSMutableString*)buf
|
||||||
|
inPara: (BOOL)flag;
|
||||||
|
- (GSXMLNode*) outputList: (GSXMLNode*)node to: (NSMutableString*)buf;
|
||||||
|
- (GSXMLNode*) outputText: (GSXMLNode*)node to: (NSMutableString*)buf;
|
||||||
|
- (void) outputUnit: (GSXMLNode*)node to: (NSMutableString*)buf;
|
||||||
|
- (void) setGlobalRefs: (AGSIndex*)r;
|
||||||
|
- (void) setLocalRefs: (AGSIndex*)r;
|
||||||
|
@end
|
||||||
|
#endif
|
701
Tools/AGSHtml.m
Normal file
701
Tools/AGSHtml.m
Normal file
|
@ -0,0 +1,701 @@
|
||||||
|
/**
|
||||||
|
|
||||||
|
<title>AGSHtml ... a class to output html for a gsdoc file</title>
|
||||||
|
Copyright <copy>(C) 2001 Free Software Foundation, Inc.</copy>
|
||||||
|
|
||||||
|
Written by: <author name="Richard Frith-Macdonald">
|
||||||
|
<email>richard@brainstorm.co.uk</email></author>
|
||||||
|
Created: October 2001
|
||||||
|
|
||||||
|
This file is part of the GNUstep Project
|
||||||
|
|
||||||
|
This library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU General Public License
|
||||||
|
as published by the Free Software Foundation; either version 2
|
||||||
|
of the License, or (at your option) any later version.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General Public
|
||||||
|
License along with this library; see the file COPYING.LIB.
|
||||||
|
If not, write to the Free Software Foundation,
|
||||||
|
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <Foundation/Foundation.h>
|
||||||
|
#include "AGSHtml.h"
|
||||||
|
|
||||||
|
static int XML_ELEMENT_NODE;
|
||||||
|
static int XML_TEXT_NODE;
|
||||||
|
|
||||||
|
@implementation AGSHtml
|
||||||
|
|
||||||
|
+ (void) initialize
|
||||||
|
{
|
||||||
|
if (self == [AGSHtml class])
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Cache XML node information.
|
||||||
|
*/
|
||||||
|
XML_ELEMENT_NODE = [GSXMLNode typeFromDescription: @"XML_ELEMENT_NODE"];
|
||||||
|
XML_TEXT_NODE = [GSXMLNode typeFromDescription: @"XML_TEXT_NODE"];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) dealloc
|
||||||
|
{
|
||||||
|
RELEASE(globalRefs);
|
||||||
|
RELEASE(localRefs);
|
||||||
|
RELEASE(indent);
|
||||||
|
[super dealloc];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) decIndent
|
||||||
|
{
|
||||||
|
unsigned len = [indent length];
|
||||||
|
|
||||||
|
if (len >= 2)
|
||||||
|
{
|
||||||
|
[indent deleteCharactersInRange: NSMakeRange(len - 2, 2)];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) incIndent
|
||||||
|
{
|
||||||
|
[indent appendString: @" "];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id) init
|
||||||
|
{
|
||||||
|
indent = [[NSMutableString alloc] initWithCapacity: 64];
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString*) outputDocument: (GSXMLNode*)node
|
||||||
|
{
|
||||||
|
NSMutableString *buf;
|
||||||
|
|
||||||
|
if (localRefs == nil)
|
||||||
|
{
|
||||||
|
localRefs = [AGSIndex new];
|
||||||
|
[localRefs makeRefs: node];
|
||||||
|
}
|
||||||
|
buf = [NSMutableString stringWithCapacity: 4096];
|
||||||
|
|
||||||
|
[buf appendString: @"<html>\n"];
|
||||||
|
[self incIndent];
|
||||||
|
[self outputNode: node to: buf];
|
||||||
|
[self decIndent];
|
||||||
|
[buf appendString: @"</html>\n"];
|
||||||
|
|
||||||
|
return buf;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf
|
||||||
|
{
|
||||||
|
GSXMLNode *children = [node children];
|
||||||
|
GSXMLNode *next = [node next];
|
||||||
|
BOOL newUnit = NO;
|
||||||
|
|
||||||
|
if ([node type] == XML_ELEMENT_NODE)
|
||||||
|
{
|
||||||
|
NSString *name = [node name];
|
||||||
|
NSDictionary *prop = [node propertiesAsDictionary];
|
||||||
|
|
||||||
|
if ([name isEqual: @"back"] == YES)
|
||||||
|
{
|
||||||
|
// Open back division
|
||||||
|
[buf appendString: indent];
|
||||||
|
[buf appendString: @"<div>\n"];
|
||||||
|
[self incIndent];
|
||||||
|
[self outputNode: children to: buf];
|
||||||
|
children = nil;
|
||||||
|
|
||||||
|
// Close back division
|
||||||
|
[self decIndent];
|
||||||
|
[buf appendString: indent];
|
||||||
|
[buf appendString: @"</div>\n"];
|
||||||
|
}
|
||||||
|
else if ([name isEqual: @"body"] == YES)
|
||||||
|
{
|
||||||
|
[buf appendString: indent];
|
||||||
|
[buf appendString: @"<body>\n"];
|
||||||
|
[self incIndent];
|
||||||
|
[self outputNode: children to: buf];
|
||||||
|
children = nil;
|
||||||
|
[self decIndent];
|
||||||
|
[buf appendString: indent];
|
||||||
|
[buf appendString: @"</body>\n"];
|
||||||
|
}
|
||||||
|
else if ([name isEqual: @"category"] == YES)
|
||||||
|
{
|
||||||
|
newUnit = YES;
|
||||||
|
unit = [NSString stringWithFormat: @"%@(%@)",
|
||||||
|
[prop objectForKey: @"class"], [prop objectForKey: @"name"]];
|
||||||
|
[self outputUnit: node to: buf];
|
||||||
|
children = nil;
|
||||||
|
}
|
||||||
|
else if ([name isEqual: @"chapter"] == YES)
|
||||||
|
{
|
||||||
|
heading = @"h1";
|
||||||
|
[self outputNode: children to: buf];
|
||||||
|
children = nil;
|
||||||
|
}
|
||||||
|
else if ([name isEqual: @"class"] == YES)
|
||||||
|
{
|
||||||
|
newUnit = YES;
|
||||||
|
unit = [prop objectForKey: @"name"];
|
||||||
|
[self outputUnit: node to: buf];
|
||||||
|
children = nil;
|
||||||
|
}
|
||||||
|
else if ([name isEqual: @"desc"] == YES)
|
||||||
|
{
|
||||||
|
[buf appendString: indent];
|
||||||
|
[buf appendString: @"<p>\n"];
|
||||||
|
[self incIndent];
|
||||||
|
[self outputBlock: children to: buf inPara: YES];
|
||||||
|
[self decIndent];
|
||||||
|
[buf appendString: indent];
|
||||||
|
[buf appendString: @"</p>\n"];
|
||||||
|
}
|
||||||
|
else if ([name isEqual: @"front"] == YES)
|
||||||
|
{
|
||||||
|
// Open front division
|
||||||
|
[buf appendString: indent];
|
||||||
|
[buf appendString: @"<div>\n"];
|
||||||
|
[self incIndent];
|
||||||
|
[self outputNode: children to: buf];
|
||||||
|
children = nil;
|
||||||
|
// Close front division
|
||||||
|
[self decIndent];
|
||||||
|
[buf appendString: indent];
|
||||||
|
[buf appendString: @"</div>\n"];
|
||||||
|
}
|
||||||
|
else if ([name isEqual: @"gsdoc"] == YES)
|
||||||
|
{
|
||||||
|
base = [prop objectForKey: @"base"];
|
||||||
|
if (base == nil)
|
||||||
|
{
|
||||||
|
NSLog(@"No 'base' document name supplied in gsdoc element");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
nextFile = [prop objectForKey: @"next"];
|
||||||
|
nextFile = [nextFile stringByAppendingPathExtension: @"html"];
|
||||||
|
prevFile = [prop objectForKey: @"pref"];
|
||||||
|
prevFile = [prevFile stringByAppendingPathExtension: @"html"];
|
||||||
|
upFile = [prop objectForKey: @"up"];
|
||||||
|
upFile = [upFile stringByAppendingPathExtension: @"html"];
|
||||||
|
}
|
||||||
|
else if ([name isEqual: @"head"] == YES)
|
||||||
|
{
|
||||||
|
[buf appendString: indent];
|
||||||
|
[buf appendString: @"<head>\n"];
|
||||||
|
[self incIndent];
|
||||||
|
[self outputNode: children to: buf];
|
||||||
|
children = nil;
|
||||||
|
[self decIndent];
|
||||||
|
[buf appendString: indent];
|
||||||
|
[buf appendString: @"</head>\n"];
|
||||||
|
}
|
||||||
|
else if ([name isEqual: @"heading"] == YES)
|
||||||
|
{
|
||||||
|
[buf appendString: indent];
|
||||||
|
[buf appendString: @"<"];
|
||||||
|
[buf appendString: heading];
|
||||||
|
[buf appendString: @">"];
|
||||||
|
[self outputText: children to: buf];
|
||||||
|
children = nil;
|
||||||
|
[buf appendString: @"</"];
|
||||||
|
[buf appendString: heading];
|
||||||
|
[buf appendString: @">\n"];
|
||||||
|
}
|
||||||
|
else if ([name isEqual: @"ivariable"] == YES)
|
||||||
|
{
|
||||||
|
NSString *tmp = [prop objectForKey: @"name"];
|
||||||
|
|
||||||
|
}
|
||||||
|
else if ([name isEqual: @"entry"] || [name isEqual: @"label"])
|
||||||
|
{
|
||||||
|
NSString *text;
|
||||||
|
NSString *val;
|
||||||
|
|
||||||
|
text = [children content];
|
||||||
|
children = nil;
|
||||||
|
val = [prop objectForKey: @"id"];
|
||||||
|
if (val == nil)
|
||||||
|
{
|
||||||
|
val = text;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ([name isEqual: @"method"] == YES)
|
||||||
|
{
|
||||||
|
NSString *sel = @"";
|
||||||
|
GSXMLNode *tmp = children;
|
||||||
|
|
||||||
|
sel = [prop objectForKey: @"factory"];
|
||||||
|
if (sel != nil && [sel boolValue] == YES)
|
||||||
|
{
|
||||||
|
sel = @"+";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sel = @"-";
|
||||||
|
}
|
||||||
|
children = nil;
|
||||||
|
while (tmp != nil)
|
||||||
|
{
|
||||||
|
if ([tmp type] == XML_ELEMENT_NODE)
|
||||||
|
{
|
||||||
|
if ([[tmp name] isEqual: @"sel"] == YES)
|
||||||
|
{
|
||||||
|
GSXMLNode *t = [tmp children];
|
||||||
|
|
||||||
|
while (t != nil)
|
||||||
|
{
|
||||||
|
if ([t type] == XML_TEXT_NODE)
|
||||||
|
{
|
||||||
|
sel = [sel stringByAppendingString: [t content]];
|
||||||
|
}
|
||||||
|
t = [t next];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ([[tmp name] isEqual: @"arg"] == NO)
|
||||||
|
{
|
||||||
|
children = tmp;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
else if ([[tmp name] isEqual: @"vararg"] == YES)
|
||||||
|
{
|
||||||
|
sel = [sel stringByAppendingString: @",..."];
|
||||||
|
children = [tmp next];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
tmp = [tmp next];
|
||||||
|
}
|
||||||
|
if ([sel length] > 1)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ([name isEqual: @"protocol"] == YES)
|
||||||
|
{
|
||||||
|
newUnit = YES;
|
||||||
|
unit = [prop objectForKey: @"name"];
|
||||||
|
[self outputUnit: node to: buf];
|
||||||
|
children = nil;
|
||||||
|
}
|
||||||
|
else if ([name isEqual: @"constant"] == YES
|
||||||
|
|| [name isEqual: @"EOEntity"] == YES
|
||||||
|
|| [name isEqual: @"EOModel"] == YES
|
||||||
|
|| [name isEqual: @"function"] == YES
|
||||||
|
|| [name isEqual: @"macro"] == YES
|
||||||
|
|| [name isEqual: @"type"] == YES
|
||||||
|
|| [name isEqual: @"variable"] == YES)
|
||||||
|
{
|
||||||
|
NSString *tmp = [prop objectForKey: @"name"];
|
||||||
|
|
||||||
|
}
|
||||||
|
else if ([name isEqual: @"section"] == YES)
|
||||||
|
{
|
||||||
|
heading = @"h2";
|
||||||
|
[self outputNode: children to: buf];
|
||||||
|
children = nil;
|
||||||
|
}
|
||||||
|
else if ([name isEqual: @"subsect"] == YES)
|
||||||
|
{
|
||||||
|
heading = @"h3";
|
||||||
|
[self outputNode: children to: buf];
|
||||||
|
children = nil;
|
||||||
|
}
|
||||||
|
else if ([name isEqual: @"subsubsect"] == YES)
|
||||||
|
{
|
||||||
|
heading = @"h4";
|
||||||
|
[self outputNode: children to: buf];
|
||||||
|
children = nil;
|
||||||
|
}
|
||||||
|
else if ([name isEqual: @"title"] == YES)
|
||||||
|
{
|
||||||
|
[buf appendString: indent];
|
||||||
|
[buf appendString: @"<title>"];
|
||||||
|
[self incIndent];
|
||||||
|
[self outputText: children to: buf];
|
||||||
|
children = nil;
|
||||||
|
[self decIndent];
|
||||||
|
[buf appendString: @"</title>\n"];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
GSXMLNode *tmp;
|
||||||
|
/*
|
||||||
|
* Try outputing as any of the common elements.
|
||||||
|
*/
|
||||||
|
tmp = [self outputBlock: node to: buf inPara: NO];
|
||||||
|
if (tmp == node)
|
||||||
|
{
|
||||||
|
NSLog(@"Element '%@' not implemented", name); // FIXME
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
next = tmp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (children != nil)
|
||||||
|
{
|
||||||
|
[self outputNode: children to: buf];
|
||||||
|
}
|
||||||
|
if (newUnit == YES)
|
||||||
|
{
|
||||||
|
unit = nil;
|
||||||
|
}
|
||||||
|
if (next != nil)
|
||||||
|
{
|
||||||
|
[self outputNode: next to: buf];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Outputs zero or more nodes at the same level as long as the nodes
|
||||||
|
* are valid %block elements. Returns nil or the first node not output.
|
||||||
|
* The value of flag is used to control paragraph nesting ... if YES
|
||||||
|
* we close a paragraph before opening a new one, and open again once
|
||||||
|
* the new paragraph closes.
|
||||||
|
*/
|
||||||
|
- (GSXMLNode*) outputBlock: (GSXMLNode*)node
|
||||||
|
to: (NSMutableString*)buf
|
||||||
|
inPara: (BOOL)flag
|
||||||
|
{
|
||||||
|
while (node != nil)
|
||||||
|
{
|
||||||
|
BOOL changed = YES;
|
||||||
|
|
||||||
|
while (changed == YES)
|
||||||
|
{
|
||||||
|
GSXMLNode *tmp = node;
|
||||||
|
|
||||||
|
node = [self outputText: node to: buf];
|
||||||
|
if (node == tmp)
|
||||||
|
{
|
||||||
|
node = [self outputList: node to: buf];
|
||||||
|
}
|
||||||
|
if (node == tmp)
|
||||||
|
{
|
||||||
|
changed = NO;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (node != nil)
|
||||||
|
{
|
||||||
|
NSString *n;
|
||||||
|
|
||||||
|
if ([node type] != XML_ELEMENT_NODE)
|
||||||
|
{
|
||||||
|
NSLog(@"Unexpected node type in block");
|
||||||
|
break; // Not a known node type;
|
||||||
|
}
|
||||||
|
n = [node name];
|
||||||
|
if ([n isEqual: @"p"] == YES)
|
||||||
|
{
|
||||||
|
if (flag == YES)
|
||||||
|
{
|
||||||
|
[self decIndent];
|
||||||
|
[buf appendString: indent];
|
||||||
|
[buf appendString: @"</p>\n"];
|
||||||
|
}
|
||||||
|
[buf appendString: indent];
|
||||||
|
[buf appendString: @"<p>\n"];
|
||||||
|
[self incIndent];
|
||||||
|
[self outputText: [node children] to: buf];
|
||||||
|
[self decIndent];
|
||||||
|
[buf appendString: indent];
|
||||||
|
[buf appendString: @"</p>\n"];
|
||||||
|
if (flag == YES)
|
||||||
|
{
|
||||||
|
[buf appendString: indent];
|
||||||
|
[buf appendString: @"<p>\n"];
|
||||||
|
[self incIndent];
|
||||||
|
}
|
||||||
|
node = [node next];
|
||||||
|
}
|
||||||
|
else if ([n isEqual: @"example"] == YES)
|
||||||
|
{
|
||||||
|
[buf appendString: @"\n<pre>\n"];
|
||||||
|
[self outputText: [node children] to: buf];
|
||||||
|
[buf appendString: @"\n</pre>\n"];
|
||||||
|
node = [node next];
|
||||||
|
}
|
||||||
|
else if ([n isEqual: @"embed"] == YES)
|
||||||
|
{
|
||||||
|
NSLog(@"Element 'embed' not supported");
|
||||||
|
node = [node next];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return node; // Not a block node.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return node;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Outputs zero or more nodes at the same level as long as the nodes
|
||||||
|
* are valid %list elements. Returns nil or the first node not output.
|
||||||
|
*/
|
||||||
|
- (GSXMLNode*) outputList: (GSXMLNode*)node to: (NSMutableString*)buf
|
||||||
|
{
|
||||||
|
while (node != nil && [node type] == XML_ELEMENT_NODE)
|
||||||
|
{
|
||||||
|
NSString *name = [node name];
|
||||||
|
GSXMLNode *children = [node children];
|
||||||
|
|
||||||
|
if ([name isEqual: @"list"] == YES)
|
||||||
|
{
|
||||||
|
[buf appendString: indent];
|
||||||
|
[buf appendString: @"<ul>\n"];
|
||||||
|
[self incIndent];
|
||||||
|
while (children != nil)
|
||||||
|
{
|
||||||
|
[buf appendString: indent];
|
||||||
|
[buf appendString: @"<li>\n"];
|
||||||
|
[self incIndent];
|
||||||
|
[self outputBlock: [children children] to: buf inPara: NO];
|
||||||
|
[self decIndent];
|
||||||
|
[buf appendString: indent];
|
||||||
|
[buf appendString: @"</li>\n"];
|
||||||
|
children = [children next];
|
||||||
|
}
|
||||||
|
[self decIndent];
|
||||||
|
[buf appendString: indent];
|
||||||
|
[buf appendString: @"</ul>\n"];
|
||||||
|
}
|
||||||
|
else if ([name isEqual: @"enum"] == YES)
|
||||||
|
{
|
||||||
|
[buf appendString: indent];
|
||||||
|
[buf appendString: @"<ol>\n"];
|
||||||
|
[self incIndent];
|
||||||
|
while (children != nil)
|
||||||
|
{
|
||||||
|
[buf appendString: indent];
|
||||||
|
[buf appendString: @"<li>\n"];
|
||||||
|
[self incIndent];
|
||||||
|
[self outputBlock: [children children] to: buf inPara: NO];
|
||||||
|
[self decIndent];
|
||||||
|
[buf appendString: indent];
|
||||||
|
[buf appendString: @"</li>\n"];
|
||||||
|
children = [children next];
|
||||||
|
}
|
||||||
|
[self decIndent];
|
||||||
|
[buf appendString: indent];
|
||||||
|
[buf appendString: @"</ol>\n"];
|
||||||
|
}
|
||||||
|
else if ([name isEqual: @"deflist"] == YES)
|
||||||
|
{
|
||||||
|
[buf appendString: indent];
|
||||||
|
[buf appendString: @"<dl>\n"];
|
||||||
|
[self incIndent];
|
||||||
|
while (children != nil)
|
||||||
|
{
|
||||||
|
[buf appendString: indent];
|
||||||
|
[buf appendString: @"<dt>"];
|
||||||
|
[self outputText: [children children] to: buf];
|
||||||
|
[buf appendString: @"</dt>\n"];
|
||||||
|
children = [children next];
|
||||||
|
[buf appendString: indent];
|
||||||
|
[buf appendString: @"<dd>\n"];
|
||||||
|
[self incIndent];
|
||||||
|
[self outputBlock: [children children] to: buf inPara: NO];
|
||||||
|
[self decIndent];
|
||||||
|
[buf appendString: indent];
|
||||||
|
[buf appendString: @"</dd>\n"];
|
||||||
|
children = [children next];
|
||||||
|
}
|
||||||
|
[self decIndent];
|
||||||
|
[buf appendString: indent];
|
||||||
|
[buf appendString: @"</dl>\n"];
|
||||||
|
}
|
||||||
|
else if ([name isEqual: @"qalist"] == YES)
|
||||||
|
{
|
||||||
|
[buf appendString: indent];
|
||||||
|
[buf appendString: @"<dl>\n"];
|
||||||
|
[self incIndent];
|
||||||
|
while (children != nil)
|
||||||
|
{
|
||||||
|
[buf appendString: indent];
|
||||||
|
[buf appendString: @"<dt>"];
|
||||||
|
[self outputText: [children children] to: buf];
|
||||||
|
[buf appendString: @"</dt>\n"];
|
||||||
|
children = [children next];
|
||||||
|
[buf appendString: indent];
|
||||||
|
[buf appendString: @"<dd>\n"];
|
||||||
|
[self incIndent];
|
||||||
|
[self outputBlock: [children children] to: buf inPara: NO];
|
||||||
|
[self decIndent];
|
||||||
|
[buf appendString: indent];
|
||||||
|
[buf appendString: @"</dd>\n"];
|
||||||
|
children = [children next];
|
||||||
|
}
|
||||||
|
[self decIndent];
|
||||||
|
[buf appendString: indent];
|
||||||
|
[buf appendString: @"</dl>\n"];
|
||||||
|
}
|
||||||
|
else if ([name isEqual: @"dictionary"] == YES)
|
||||||
|
{
|
||||||
|
NSLog(@"Element '%@' not implemented", name); // FIXME
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return node; // Not a list
|
||||||
|
}
|
||||||
|
node = [node next];
|
||||||
|
}
|
||||||
|
return node;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Outputs zero or more nodes at the same level as long as the nodes
|
||||||
|
* are valid %text elements. Returns nil or the first node not output.
|
||||||
|
*/
|
||||||
|
- (GSXMLNode*) outputText: (GSXMLNode*)node to: (NSMutableString*)buf
|
||||||
|
{
|
||||||
|
while (node != nil)
|
||||||
|
{
|
||||||
|
if ([node type] == XML_TEXT_NODE)
|
||||||
|
{
|
||||||
|
[buf appendString: [node content]];
|
||||||
|
}
|
||||||
|
else if ([node type] == XML_ELEMENT_NODE)
|
||||||
|
{
|
||||||
|
NSString *name = [node name];
|
||||||
|
GSXMLNode *children = [node children];
|
||||||
|
NSDictionary *prop = [node propertiesAsDictionary];
|
||||||
|
|
||||||
|
if ([name isEqual: @"br"] == YES)
|
||||||
|
{
|
||||||
|
[buf appendString: @"<br />"];
|
||||||
|
}
|
||||||
|
else if ([name isEqual: @"ref"] == YES) // %xref
|
||||||
|
{
|
||||||
|
NSLog(@"Element '%@' not implemented", name); // FIXME
|
||||||
|
}
|
||||||
|
else if ([name isEqual: @"uref"] == YES)
|
||||||
|
{
|
||||||
|
[buf appendString: @"<a href=\""];
|
||||||
|
[buf appendString: [prop objectForKey: @"url"]];
|
||||||
|
[buf appendString: @"\">"];
|
||||||
|
[self outputText: children to: buf];
|
||||||
|
[buf appendString: @"</a>"];
|
||||||
|
}
|
||||||
|
else if ([name isEqual: @"url"] == YES)
|
||||||
|
{
|
||||||
|
NSLog(@"Element '%@' not implemented", name); // FIXME
|
||||||
|
}
|
||||||
|
else if ([name isEqual: @"email"] == YES)
|
||||||
|
{
|
||||||
|
NSLog(@"Element '%@' not implemented", name); // FIXME
|
||||||
|
}
|
||||||
|
else if ([name isEqual: @"prjref"] == YES)
|
||||||
|
{
|
||||||
|
NSLog(@"Element '%@' not implemented", name); // FIXME
|
||||||
|
}
|
||||||
|
else if ([name isEqual: @"label"] == YES) // %anchor
|
||||||
|
{
|
||||||
|
NSLog(@"Element '%@' not implemented", name); // FIXME
|
||||||
|
}
|
||||||
|
else if ([name isEqual: @"entry"] == YES)
|
||||||
|
{
|
||||||
|
NSLog(@"Element '%@' not implemented", name); // FIXME
|
||||||
|
}
|
||||||
|
else if ([name isEqual: @"var"] == YES) // %phrase
|
||||||
|
{
|
||||||
|
[buf appendString: @"<var>"];
|
||||||
|
[self outputText: children to: buf];
|
||||||
|
[buf appendString: @"</var>"];
|
||||||
|
}
|
||||||
|
else if ([name isEqual: @"em"] == YES)
|
||||||
|
{
|
||||||
|
[buf appendString: @"<em>"];
|
||||||
|
[self outputText: children to: buf];
|
||||||
|
[buf appendString: @"</em>"];
|
||||||
|
}
|
||||||
|
else if ([name isEqual: @"code"] == YES)
|
||||||
|
{
|
||||||
|
[buf appendString: @"<code>"];
|
||||||
|
[self outputText: children to: buf];
|
||||||
|
[buf appendString: @"</code>"];
|
||||||
|
}
|
||||||
|
else if ([name isEqual: @"file"] == YES)
|
||||||
|
{
|
||||||
|
[buf appendString: @"<code>"];
|
||||||
|
[self outputText: children to: buf];
|
||||||
|
[buf appendString: @"</code>"];
|
||||||
|
}
|
||||||
|
else if ([name isEqual: @"site"] == YES)
|
||||||
|
{
|
||||||
|
[buf appendString: @"<code>"];
|
||||||
|
[self outputText: children to: buf];
|
||||||
|
[buf appendString: @"</code>"];
|
||||||
|
}
|
||||||
|
else if ([name isEqual: @"footnote"] == YES)
|
||||||
|
{
|
||||||
|
NSLog(@"Element '%@' not implemented", name); // FIXME
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return node; // Not a text node.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
node = [node next];
|
||||||
|
}
|
||||||
|
return node;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) outputUnit: (GSXMLNode*)node to: (NSMutableString*)buf
|
||||||
|
{
|
||||||
|
GSXMLNode *u = node;
|
||||||
|
|
||||||
|
node = [node children];
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
[buf appendString: indent];
|
||||||
|
[buf appendString: @"Conform: "];
|
||||||
|
[self outputText: [node children] to: buf];
|
||||||
|
[buf appendString: @"<br />\n"];
|
||||||
|
node = [node next];
|
||||||
|
}
|
||||||
|
if (node != nil && [[node name] isEqual: @"desc"] == YES)
|
||||||
|
{
|
||||||
|
[self outputNode: node to: buf];
|
||||||
|
node = [node next];
|
||||||
|
}
|
||||||
|
while (node != nil && [[node name] isEqual: @"method"] == YES)
|
||||||
|
{
|
||||||
|
[self outputNode: node to: buf];
|
||||||
|
node = [node next];
|
||||||
|
}
|
||||||
|
if (node != nil && [[node name] isEqual: @"standaards"] == YES)
|
||||||
|
{
|
||||||
|
[self outputNode: node to: buf];
|
||||||
|
node = [node next];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) setGlobalRefs: (AGSIndex*)r
|
||||||
|
{
|
||||||
|
ASSIGN(globalRefs, r);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) setLocalRefs: (AGSIndex*)r
|
||||||
|
{
|
||||||
|
ASSIGN(localRefs, r);
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
#ifndef _INCLUDED_AGSINDEX_H
|
||||||
|
#define _INCLUDED_AGSINDEX_H
|
||||||
/**
|
/**
|
||||||
|
|
||||||
<title>AGSIndex ... a class to create references for a gsdoc file</title>
|
<title>AGSIndex ... a class to create references for a gsdoc file</title>
|
||||||
|
@ -35,4 +37,4 @@
|
||||||
- (void) setGlobalRef: (NSString*)ref type: (NSString*)type;
|
- (void) setGlobalRef: (NSString*)ref type: (NSString*)type;
|
||||||
- (void) setUnitRef: (NSString*)ref type: (NSString*)type;
|
- (void) setUnitRef: (NSString*)ref type: (NSString*)type;
|
||||||
@end
|
@end
|
||||||
|
#endif
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
#ifndef _INCLUDED_AGSOUTPUT_H
|
||||||
|
#define _INCLUDED_AGSOUTPUT_H
|
||||||
/**
|
/**
|
||||||
|
|
||||||
<title>AGSOutput ... a class to output gsdoc source</title>
|
<title>AGSOutput ... a class to output gsdoc source</title>
|
||||||
|
@ -45,5 +47,4 @@
|
||||||
to: (NSMutableString*)buf;
|
to: (NSMutableString*)buf;
|
||||||
- (NSArray*) split: (NSString*)str;
|
- (NSArray*) split: (NSString*)str;
|
||||||
@end
|
@end
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -196,8 +196,8 @@ static BOOL snuggleStart(NSString *t)
|
||||||
|
|
||||||
[str appendString: @"<?xml version=\"1.0\"?>\n"];
|
[str appendString: @"<?xml version=\"1.0\"?>\n"];
|
||||||
[str appendString: @"<!DOCTYPE gsdoc PUBLIC "];
|
[str appendString: @"<!DOCTYPE gsdoc PUBLIC "];
|
||||||
[str appendString: @"\"-//GNUstep//DTD gsdoc 0.6.6//EN\" "];
|
[str appendString: @"\"-//GNUstep//DTD gsdoc 0.6.7//EN\" "];
|
||||||
[str appendString: @"\"http://www.gnustep.org/gsdoc-0_6_6.xml\">\n"];
|
[str appendString: @"\"http://www.gnustep.org/gsdoc-0_6_7.xml\">\n"];
|
||||||
[str appendFormat: @"<gsdoc"];
|
[str appendFormat: @"<gsdoc"];
|
||||||
|
|
||||||
tmp = [info objectForKey: @"base"];
|
tmp = [info objectForKey: @"base"];
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
#ifndef _INCLUDED_AGSPARSER_H
|
||||||
|
#define _INCLUDED_AGSPARSER_H
|
||||||
/**
|
/**
|
||||||
|
|
||||||
<title>AGSParser ... a tool to get documention info from ObjC source</title>
|
<title>AGSParser ... a tool to get documention info from ObjC source</title>
|
||||||
|
@ -81,4 +83,4 @@
|
||||||
- (unsigned) skipUnit;
|
- (unsigned) skipUnit;
|
||||||
- (unsigned) skipWhiteSpace;
|
- (unsigned) skipWhiteSpace;
|
||||||
@end
|
@end
|
||||||
|
#endif
|
||||||
|
|
|
@ -33,7 +33,7 @@ include ../config.mak
|
||||||
|
|
||||||
# DTDs to install
|
# DTDs to install
|
||||||
dtddir = $(GNUSTEP_RESOURCES)/DTDs
|
dtddir = $(GNUSTEP_RESOURCES)/DTDs
|
||||||
DTD_FILES = gsdoc-0_6_5.dtd gsdoc-0_6_6.dtd
|
DTD_FILES = gsdoc-0_6_5.dtd gsdoc-0_6_6.dtd gsdoc-0_6_7.dtd
|
||||||
|
|
||||||
# DocTemplates to install
|
# DocTemplates to install
|
||||||
doctemplatesdir = $(GNUSTEP_RESOURCES)/DocTemplates
|
doctemplatesdir = $(GNUSTEP_RESOURCES)/DocTemplates
|
||||||
|
@ -47,7 +47,7 @@ CTOOL_NAME = gdomap
|
||||||
TEST_TOOL_NAME = locale_alias
|
TEST_TOOL_NAME = locale_alias
|
||||||
|
|
||||||
# The source files to be compiled
|
# The source files to be compiled
|
||||||
autogsdoc_OBJC_FILES = autogsdoc.m AGSParser.m AGSOutput.m AGSIndex.m
|
autogsdoc_OBJC_FILES = autogsdoc.m AGSParser.m AGSOutput.m AGSIndex.m AGSHtml.m
|
||||||
gdomap_C_FILES = gdomap.c
|
gdomap_C_FILES = gdomap.c
|
||||||
gdnc_OBJC_FILES = gdnc.m
|
gdnc_OBJC_FILES = gdnc.m
|
||||||
gsdoc_OBJC_FILES = gsdoc.m
|
gsdoc_OBJC_FILES = gsdoc.m
|
||||||
|
|
|
@ -185,6 +185,7 @@
|
||||||
#include "AGSParser.h"
|
#include "AGSParser.h"
|
||||||
#include "AGSOutput.h"
|
#include "AGSOutput.h"
|
||||||
#include "AGSIndex.h"
|
#include "AGSIndex.h"
|
||||||
|
#include "AGSHtml.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char **argv, char **env)
|
main(int argc, char **argv, char **env)
|
||||||
|
@ -330,6 +331,8 @@ main(int argc, char **argv, char **env)
|
||||||
{
|
{
|
||||||
CREATE_AUTORELEASE_POOL(pool);
|
CREATE_AUTORELEASE_POOL(pool);
|
||||||
GSXMLParser *parser;
|
GSXMLParser *parser;
|
||||||
|
AGSIndex *locRefs;
|
||||||
|
AGSHtml *html;
|
||||||
|
|
||||||
parser = [GSXMLParser parserWithContentsOfFile: ddir];
|
parser = [GSXMLParser parserWithContentsOfFile: ddir];
|
||||||
[parser substituteEntities: YES];
|
[parser substituteEntities: YES];
|
||||||
|
@ -344,10 +347,42 @@ main(int argc, char **argv, char **env)
|
||||||
[[[parser doc] root] name]);
|
[[[parser doc] root] name]);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
[indexer makeRefs: [[parser doc] root]];
|
|
||||||
|
locRefs = AUTORELEASE([AGSIndex new]);
|
||||||
|
[locRefs makeRefs: [[parser doc] root]];
|
||||||
|
|
||||||
|
html = AUTORELEASE([AGSHtml new]);
|
||||||
|
[html setLocalRefs: indexer];
|
||||||
|
[html outputDocument: [[parser doc] root]];
|
||||||
|
|
||||||
|
[indexer mergeRefs: [locRefs refs]];
|
||||||
|
|
||||||
RELEASE(pool);
|
RELEASE(pool);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if ([arg hasSuffix: @".gsdoc"] == YES)
|
||||||
|
{
|
||||||
|
CREATE_AUTORELEASE_POOL(pool);
|
||||||
|
GSXMLParser *parser;
|
||||||
|
AGSHtml *html;
|
||||||
|
|
||||||
|
parser = [GSXMLParser parserWithContentsOfFile: arg];
|
||||||
|
[parser substituteEntities: YES];
|
||||||
|
[parser doValidityChecking: YES];
|
||||||
|
if ([parser parse] == NO)
|
||||||
|
{
|
||||||
|
NSLog(@"WARNING %@ did not produce a valid document", arg);
|
||||||
|
}
|
||||||
|
if (![[[[parser doc] root] name] isEqualToString: @"gsdoc"])
|
||||||
|
{
|
||||||
|
NSLog(@"not a gsdoc document - because name node is %@",
|
||||||
|
[[[parser doc] root] name]);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
html = AUTORELEASE([AGSHtml new]);
|
||||||
|
NSLog(@"%@", [html outputDocument: [[parser doc] root]]);
|
||||||
|
RELEASE(pool);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NSLog(@"Unknown argument '%@' ... ignored", arg);
|
NSLog(@"Unknown argument '%@' ... ignored", arg);
|
||||||
|
|
550
Tools/gsdoc-0_6_7.dtd
Normal file
550
Tools/gsdoc-0_6_7.dtd
Normal file
|
@ -0,0 +1,550 @@
|
||||||
|
<!--
|
||||||
|
|
||||||
|
XML Document Type Definition for GNUstep Documentation Markup
|
||||||
|
Language (gsdoc).
|
||||||
|
|
||||||
|
Written by Richard Frith-Macdonald
|
||||||
|
Based on GDML by 1997 Yoo C. Chung
|
||||||
|
|
||||||
|
This is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU General Public License
|
||||||
|
as published by the Free Software Foundation; either
|
||||||
|
version 2 of the License, or (at your option) any later
|
||||||
|
version.
|
||||||
|
|
||||||
|
This document is distributed in the hope that it will be
|
||||||
|
useful, but WITHOUT ANY WARRANTY; without even the implied
|
||||||
|
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. See the GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU General
|
||||||
|
Public License along with this software; if not, write to the
|
||||||
|
Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA
|
||||||
|
02139, USA.
|
||||||
|
|
||||||
|
-->
|
||||||
|
|
||||||
|
|
||||||
|
<!--
|
||||||
|
gsdoc is an XML language - Typical usage:
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<!DOCTYPE gsdoc PUBLIC "-//GNUstep//DTD gsdoc 0.6.7//EN"
|
||||||
|
"http://www.gnustep.org/gsdoc.xml">
|
||||||
|
<gsdoc base="myDocName">
|
||||||
|
</gsdoc>
|
||||||
|
-->
|
||||||
|
|
||||||
|
|
||||||
|
<!--***** Character entities. *****-->
|
||||||
|
|
||||||
|
<!-- General purpose characters for gsdoc. -->
|
||||||
|
<!ENTITY copy "&copy;"> <!-- copyright symbol -->
|
||||||
|
<!ENTITY tm "&trade;"> <!-- trademark symbol -->
|
||||||
|
<!ENTITY dots "&dots;"> <!-- ellipsis (...) -->
|
||||||
|
<!ENTITY nbsp "&nbsp;"> <!-- non breakable space -->
|
||||||
|
<!ENTITY amp "&#38;"> <!-- ampersand -->
|
||||||
|
<!ENTITY apos "'"> <!-- apos -->
|
||||||
|
<!ENTITY quot """> <!-- quotation mark (") -->
|
||||||
|
<!ENTITY lt "&#60;"> <!-- lesser than symbol -->
|
||||||
|
<!ENTITY gt ">"> <!-- greater than symbol -->
|
||||||
|
|
||||||
|
<!--***** Entity declarations. *****-->
|
||||||
|
|
||||||
|
<!-- Boolean values for attributes -->
|
||||||
|
<!ENTITY % boolean "(yes|no)">
|
||||||
|
|
||||||
|
<!-- Entity for phrase elements. -->
|
||||||
|
<!ENTITY % phrase "var | em | code | strong | file | site">
|
||||||
|
|
||||||
|
<!-- Entity for cross references. -->
|
||||||
|
<!ENTITY % xref "ref | uref | url | email | prjref">
|
||||||
|
|
||||||
|
<!-- Entity for anchors. -->
|
||||||
|
<!ENTITY % anchor "label | entry">
|
||||||
|
|
||||||
|
<!-- Entity for simple text level elements. -->
|
||||||
|
<!ENTITY % text "#PCDATA | %xref; | %anchor; | %phrase; | footnote | br">
|
||||||
|
|
||||||
|
<!-- Entity for list elements. -->
|
||||||
|
<!ENTITY % list "list | enum | deflist | qalist | dictionary">
|
||||||
|
|
||||||
|
<!-- Entity for block level elements. -->
|
||||||
|
<!ENTITY % block "%text; | %list; | p | example | embed">
|
||||||
|
|
||||||
|
<!-- Entity for definition elements and blocks. -->
|
||||||
|
<!ENTITY % defblock "%list; | p | example | embed | class | category | protocol | function | macro | type | variable | constant | EOModel | EOEntity">
|
||||||
|
|
||||||
|
<!--**********-->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Used for describing something. -->
|
||||||
|
<!ELEMENT desc (%block;)*>
|
||||||
|
|
||||||
|
<!-- A footnote. -->
|
||||||
|
<!ELEMENT footnote (%text;)*>
|
||||||
|
|
||||||
|
|
||||||
|
<!--***** Phrase elements. *****-->
|
||||||
|
|
||||||
|
<!-- The content is a metasyntactic variable or argument name. -->
|
||||||
|
<!ELEMENT var (%text;)*>
|
||||||
|
|
||||||
|
<!-- The content is a metasyntactic ivariable name. -->
|
||||||
|
<!ELEMENT ivar (%text;)*>
|
||||||
|
|
||||||
|
<!-- Emphasize the content. -->
|
||||||
|
<!ELEMENT em (%text;)*>
|
||||||
|
|
||||||
|
<!-- The content is too important that simple emphasizing isn't
|
||||||
|
enough. -->
|
||||||
|
<!ELEMENT strong (%text;)*>
|
||||||
|
|
||||||
|
<!-- The content is either a name for code (e.g. class names), or a
|
||||||
|
relatively short code fragment. -->
|
||||||
|
<!ELEMENT code (%text;)*>
|
||||||
|
|
||||||
|
<!-- The content is a file name. -->
|
||||||
|
<!ELEMENT file (#PCDATA)*>
|
||||||
|
|
||||||
|
<!-- The content is a fully qualified domain name on the Internet. -->
|
||||||
|
<!ELEMENT site (#PCDATA)*>
|
||||||
|
|
||||||
|
<!--***** List elements. *****-->
|
||||||
|
|
||||||
|
<!-- An item in a list. -->
|
||||||
|
<!ELEMENT item (%block;)*>
|
||||||
|
|
||||||
|
<!-- An enumerated list. -->
|
||||||
|
<!ELEMENT enum (item+)>
|
||||||
|
|
||||||
|
<!-- A ordinary, unnumbered list. -->
|
||||||
|
<!ELEMENT list (item+)>
|
||||||
|
|
||||||
|
<!-- A term to defined in a definition list. -->
|
||||||
|
<!ELEMENT term (%text;)*>
|
||||||
|
|
||||||
|
<!-- A definition list. -->
|
||||||
|
<!ELEMENT deflist (term, desc)+>
|
||||||
|
|
||||||
|
<!-- A question for a question and answer list. -->
|
||||||
|
<!ELEMENT question (%text;)*>
|
||||||
|
|
||||||
|
<!-- An answer for a question and answer list. -->
|
||||||
|
<!ELEMENT answer (%block;)*>
|
||||||
|
|
||||||
|
<!-- A question and answer list. -->
|
||||||
|
<!ELEMENT qalist (question, answer)+>
|
||||||
|
|
||||||
|
<!--**********-->
|
||||||
|
|
||||||
|
|
||||||
|
<!--***** Cross references. *****-->
|
||||||
|
|
||||||
|
<!-- A reference.
|
||||||
|
ID of the reference.
|
||||||
|
TYPE of reference, if implied, a reference to a label.
|
||||||
|
CLASS specific class for a method, may be one of the following formats -
|
||||||
|
classname, classname(categoryname), (protocolname)
|
||||||
|
-->
|
||||||
|
<!ELEMENT ref (%text;)*>
|
||||||
|
<!ATTLIST ref
|
||||||
|
id CDATA #REQUIRED
|
||||||
|
type (class|protocol|method|function|type|macro|variable|constant|label|EOModel|EOEntity) "label"
|
||||||
|
class CDATA #IMPLIED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- An e-mail address. -->
|
||||||
|
<!ELEMENT email (%text;)*>
|
||||||
|
<!ATTLIST email
|
||||||
|
address CDATA #IMPLIED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- A URL. -->
|
||||||
|
<!ELEMENT url EMPTY>
|
||||||
|
<!ATTLIST url
|
||||||
|
url CDATA #IMPLIED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- A reference to a URL.
|
||||||
|
The text contained appears in the output.
|
||||||
|
-->
|
||||||
|
<!ELEMENT uref (%text;)*>
|
||||||
|
<!ATTLIST uref
|
||||||
|
url CDATA #REQUIRED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- A reference to a project.
|
||||||
|
The text contained appears in the output.
|
||||||
|
-->
|
||||||
|
<!ELEMENT prjref (%text;)*>
|
||||||
|
<!ATTLIST prjref
|
||||||
|
prjname CDATA #IMPLIED
|
||||||
|
file CDATA #IMPLIED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!--***** Anchors. *****-->
|
||||||
|
|
||||||
|
<!-- An anchor for a general reference.
|
||||||
|
The text contained appears in the output.
|
||||||
|
If the id attribute is omitted, the text is used in its place.
|
||||||
|
-->
|
||||||
|
<!ELEMENT label (%text;)*>
|
||||||
|
<!ATTLIST label
|
||||||
|
id CDATA #IMPLIED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- An entry for the general index.
|
||||||
|
The text that is contained appears in the index, and never in
|
||||||
|
the text itself.
|
||||||
|
If the id attribute is omitted, the text is used in its place.
|
||||||
|
-->
|
||||||
|
<!ELEMENT entry (%text;)*>
|
||||||
|
<!ATTLIST entry
|
||||||
|
id CDATA #IMPLIED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- Entity for standard elements. -->
|
||||||
|
<!ELEMENT GNUstep EMPTY>
|
||||||
|
<!ELEMENT OpenStep EMPTY>
|
||||||
|
<!ELEMENT NotOpenStep EMPTY>
|
||||||
|
<!ELEMENT MacOS-X EMPTY>
|
||||||
|
<!ELEMENT NotMacOS-X EMPTY>
|
||||||
|
|
||||||
|
<!-- A standard that something is or isn't compliant with. -->
|
||||||
|
<!ENTITY % standard "GNUstep | OpenStep | NotOpenStep | MacOS-X | NotMacOS-X">
|
||||||
|
|
||||||
|
<!ELEMENT standards (%standard;)*>
|
||||||
|
|
||||||
|
<!--***** Argument elements. *****-->
|
||||||
|
|
||||||
|
<!-- An argument. -->
|
||||||
|
<!ELEMENT arg (#PCDATA)*>
|
||||||
|
<!ATTLIST arg
|
||||||
|
type CDATA #IMPLIED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- Denotes that the rest of the arguments is a variable list,
|
||||||
|
like in printf().
|
||||||
|
-->
|
||||||
|
<!ELEMENT vararg EMPTY>
|
||||||
|
|
||||||
|
|
||||||
|
<!--***** Method elements. *****-->
|
||||||
|
|
||||||
|
<!-- A component for a method selector. -->
|
||||||
|
<!ELEMENT sel (#PCDATA)*>
|
||||||
|
|
||||||
|
<!-- A method. If there is no DESC, it is understood that the element
|
||||||
|
is used to override some information from the same method in the
|
||||||
|
superclass.
|
||||||
|
If factory not set, instance method
|
||||||
|
-->
|
||||||
|
<!ELEMENT method (((sel, arg?), (sel, arg)*, vararg?), desc?, standards?)>
|
||||||
|
<!ATTLIST method
|
||||||
|
type CDATA #IMPLIED
|
||||||
|
factory %boolean; "no"
|
||||||
|
init %boolean; "no"
|
||||||
|
override (subclass|never) #IMPLIED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!--***** Elements for definitions of classes, functions, etc. *****-->
|
||||||
|
|
||||||
|
<!-- Show what header file something lives in. -->
|
||||||
|
<!ELEMENT declared (#PCDATA)*>
|
||||||
|
|
||||||
|
<!-- A macro definition. -->
|
||||||
|
<!ELEMENT macro ((arg*, vararg?), declared?, desc?, standards?)>
|
||||||
|
<!ATTLIST macro
|
||||||
|
name CDATA #REQUIRED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!ELEMENT typespec (#PCDATA)*>
|
||||||
|
|
||||||
|
<!-- A type definition. -->
|
||||||
|
<!ELEMENT type (typespec, declared?, desc?, standards?)>
|
||||||
|
<!ATTLIST type
|
||||||
|
name CDATA #REQUIRED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- Variable definition.
|
||||||
|
VALUE may be set for a constant or a default value
|
||||||
|
-->
|
||||||
|
<!ELEMENT variable (declared?, desc?, standards?)>
|
||||||
|
<!ATTLIST variable
|
||||||
|
name CDATA #REQUIRED
|
||||||
|
type CDATA #REQUIRED
|
||||||
|
posttype CDATA #REQUIRED
|
||||||
|
value CDATA #IMPLIED
|
||||||
|
role (except|defaults|notify|key) #IMPLIED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- Ivariable definition.
|
||||||
|
VALUE may be set for a constant or a default value
|
||||||
|
-->
|
||||||
|
<!ELEMENT ivariable (declared?, desc?, standards?)>
|
||||||
|
<!ATTLIST ivariable
|
||||||
|
name CDATA #REQUIRED
|
||||||
|
type CDATA #REQUIRED
|
||||||
|
posttype CDATA #REQUIRED
|
||||||
|
value CDATA #IMPLIED
|
||||||
|
role (except|defaults|notify|key) #IMPLIED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- Constant definition.
|
||||||
|
VALUE may be set for a constant or a default value
|
||||||
|
-->
|
||||||
|
<!ELEMENT constant (declared?, desc?, standards?)>
|
||||||
|
<!ATTLIST constant
|
||||||
|
name CDATA #REQUIRED
|
||||||
|
value CDATA #IMPLIED
|
||||||
|
role (except|defaults|notify|key) #IMPLIED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- A function definition. -->
|
||||||
|
<!ELEMENT function ((arg*, vararg?), declared?, desc?, standards?)>
|
||||||
|
<!ATTLIST function
|
||||||
|
name CDATA #REQUIRED
|
||||||
|
type CDATA #REQUIRED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- Protocol definition. -->
|
||||||
|
<!ELEMENT protocol (declared?, desc?, method*, standards?)>
|
||||||
|
<!ATTLIST protocol
|
||||||
|
name CDATA #REQUIRED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- Category definition. -->
|
||||||
|
<!ELEMENT category (declared?, conform*, desc?, method*, standards?)>
|
||||||
|
<!ATTLIST category
|
||||||
|
name CDATA #REQUIRED
|
||||||
|
class CDATA #REQUIRED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- Show a protocol a class conforms to. -->
|
||||||
|
<!ELEMENT conform (#PCDATA)*>
|
||||||
|
|
||||||
|
<!ELEMENT class (declared?, conform*, desc?, ivariable*, method*, standards?)>
|
||||||
|
<!ATTLIST class
|
||||||
|
name CDATA #REQUIRED
|
||||||
|
super CDATA #IMPLIED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!--***** Elements for definitions of EOModels, etc. *****-->
|
||||||
|
|
||||||
|
<!-- a dictionary Item. -->
|
||||||
|
<!ELEMENT dictionaryItem (%block;)*>
|
||||||
|
<!ATTLIST dictionaryItem
|
||||||
|
key CDATA #REQUIRED
|
||||||
|
value CDATA #IMPLIED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- a dictionary -->
|
||||||
|
<!ELEMENT dictionary (dictionaryItem+)>
|
||||||
|
|
||||||
|
<!ELEMENT EOConnectionDictionary (dictionaryItem+)>
|
||||||
|
|
||||||
|
<!ELEMENT EOUserDictionary (dictionaryItem+)>
|
||||||
|
|
||||||
|
<!--***** Elements for definitions of EOModels, etc. *****-->
|
||||||
|
|
||||||
|
<!-- EORelationshipComponent -->
|
||||||
|
<!ELEMENT EORelationshipComponent (EORelationshipComponent*)>
|
||||||
|
<!ATTLIST EORelationshipComponent
|
||||||
|
definition CDATA #REQUIRED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- EOJoin -->
|
||||||
|
<!ELEMENT EOJoin (desc?)>
|
||||||
|
<!ATTLIST EOJoin
|
||||||
|
relationshipName CDATA #IMPLIED
|
||||||
|
joinOperator CDATA #REQUIRED
|
||||||
|
joinSemantic CDATA #REQUIRED
|
||||||
|
sourceAttribute CDATA #REQUIRED
|
||||||
|
destinationAttribute CDATA #REQUIRED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- EORelationship -->
|
||||||
|
<!ELEMENT EORelationship ((EORelationshipComponent | (EOJoin*)), EOUserDictionary?, desc?)>
|
||||||
|
<!ATTLIST EORelationship
|
||||||
|
entityName CDATA #REQUIRED
|
||||||
|
destinationEntityName CDATA #REQUIRED
|
||||||
|
name CDATA #REQUIRED
|
||||||
|
isToMany CDATA #IMPLIED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- EOAttributeRef -->
|
||||||
|
<!ELEMENT EOAttributeRef EMPTY>
|
||||||
|
<!ATTLIST EOAttributeRef
|
||||||
|
name CDATA #REQUIRED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- EOPrimaryKeyAttributes -->
|
||||||
|
<!ELEMENT EOPrimaryKeyAttributes (EOAttributeRef+)>
|
||||||
|
|
||||||
|
<!-- EOClassProperties -->
|
||||||
|
<!ELEMENT EOClassProperties ((EOAttributeRef)+)>
|
||||||
|
|
||||||
|
<!-- EOAttributesUsedForLocking -->
|
||||||
|
<!ELEMENT EOAttributesUsedForLocking (EOAttributeRef+)>
|
||||||
|
|
||||||
|
<!-- EOAttribute -->
|
||||||
|
<!ELEMENT EOAttribute (EOUserDictionary?, desc?)>
|
||||||
|
<!ATTLIST EOAttribute
|
||||||
|
columnName CDATA #IMPLIED
|
||||||
|
definition CDATA #IMPLIED
|
||||||
|
externalType CDATA #IMPLIED
|
||||||
|
name CDATA #REQUIRED
|
||||||
|
valueClassName CDATA #IMPLIED
|
||||||
|
valueType CDATA #IMPLIED
|
||||||
|
entityName CDATA #IMPLIED
|
||||||
|
isReadOnly CDATA #IMPLIED
|
||||||
|
isDerived CDATA #IMPLIED
|
||||||
|
isFlattened CDATA #IMPLIED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- EOEntity -->
|
||||||
|
<!ELEMENT EOEntity (EOAttribute*, EOAttributesUsedForLocking?, EOClassProperties?, EOPrimaryKeyAttributes?, EORelationship*, EOUserDictionary?, desc?)>
|
||||||
|
<!ATTLIST EOEntity
|
||||||
|
name CDATA #REQUIRED
|
||||||
|
externalName CDATA #IMPLIED
|
||||||
|
className CDATA #IMPLIED
|
||||||
|
modelName CDATA #IMPLIED
|
||||||
|
isReadOnly CDATA #IMPLIED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- EOModel -->
|
||||||
|
<!ELEMENT EOModel (EOConnectionDictionary?, (EOEntity+ | list), EOUserDictionary?, desc?)>
|
||||||
|
<!ATTLIST EOModel
|
||||||
|
name CDATA #REQUIRED
|
||||||
|
version CDATA #IMPLIED
|
||||||
|
adaptorName CDATA #REQUIRED
|
||||||
|
adaptorClassName CDATA #REQUIRED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!--***** Elements for ordinary block level elements. *****-->
|
||||||
|
|
||||||
|
<!-- A line break. -->
|
||||||
|
<!ELEMENT br EMPTY>
|
||||||
|
|
||||||
|
<!-- A paragraph. -->
|
||||||
|
<!ELEMENT p (%text;)*>
|
||||||
|
|
||||||
|
<!-- An example. -->
|
||||||
|
<!ELEMENT example (#PCDATA)*>
|
||||||
|
<!ATTLIST example
|
||||||
|
caption CDATA #IMPLIED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- An embedded object. If it is of a type that the SGML processor
|
||||||
|
cannot handle, then use the content, which is ignored otherwise.
|
||||||
|
refer - method of referring to object (default is file)
|
||||||
|
src - the reference to the object
|
||||||
|
type - Internet media type of the objec
|
||||||
|
title - optional title describing object
|
||||||
|
-->
|
||||||
|
<!ELEMENT embed (%block;)*>
|
||||||
|
<!ATTLIST embed
|
||||||
|
refer (file|url) #IMPLIED
|
||||||
|
src CDATA #REQUIRED
|
||||||
|
type CDATA #IMPLIED
|
||||||
|
title CDATA #IMPLIED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!--***** Elements for document structure such as chapters. *****-->
|
||||||
|
|
||||||
|
<!-- A heading for chapters, sections, ... -->
|
||||||
|
<!ELEMENT heading (%text;)*>
|
||||||
|
|
||||||
|
<!-- A subsubsection. -->
|
||||||
|
<!ELEMENT subsubsect (heading, (%defblock;)*)>
|
||||||
|
<!ATTLIST subsubsect
|
||||||
|
id CDATA #IMPLIED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- A subsection. -->
|
||||||
|
<!ELEMENT subsect (heading, (%defblock;)*, subsubsect*)>
|
||||||
|
<!ATTLIST subsect
|
||||||
|
id CDATA #IMPLIED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- A section. -->
|
||||||
|
<!ELEMENT section (heading, (%defblock;)*, subsect*)>
|
||||||
|
<!ATTLIST section
|
||||||
|
id CDATA #IMPLIED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- A chapter. -->
|
||||||
|
<!ELEMENT chapter (heading, (%defblock;)*, section*)>
|
||||||
|
<!ATTLIST chapter
|
||||||
|
id CDATA #IMPLIED
|
||||||
|
>
|
||||||
|
|
||||||
|
|
||||||
|
<!--***** Elements that make searching for things easier. *****-->
|
||||||
|
|
||||||
|
<!-- Table of contents. -->
|
||||||
|
<!ELEMENT contents EMPTY>
|
||||||
|
|
||||||
|
<!-- Index -->
|
||||||
|
<!ELEMENT index EMPTY>
|
||||||
|
<!ATTLIST index
|
||||||
|
type (class | protocol | method | function | type | macro | variable | constant | label) "label"
|
||||||
|
>
|
||||||
|
|
||||||
|
|
||||||
|
<!--***** Elements that describe the document itself. *****-->
|
||||||
|
|
||||||
|
<!-- Copyright of the document. -->
|
||||||
|
<!ELEMENT copy (%text;)*>
|
||||||
|
|
||||||
|
<!-- An abstract. -->
|
||||||
|
<!ELEMENT abstract (%text;)*>
|
||||||
|
|
||||||
|
<!-- The version of the document. -->
|
||||||
|
<!ELEMENT version (%text;)*>
|
||||||
|
|
||||||
|
<!-- The date the document was written. -->
|
||||||
|
<!ELEMENT date (%text;)*>
|
||||||
|
|
||||||
|
<!-- An author. -->
|
||||||
|
<!ELEMENT author (email?, url?, desc?)>
|
||||||
|
<!ATTLIST author
|
||||||
|
name CDATA #REQUIRED
|
||||||
|
>
|
||||||
|
|
||||||
|
<!-- The title of the document. -->
|
||||||
|
<!ELEMENT title (%text;)*>
|
||||||
|
|
||||||
|
|
||||||
|
<!--***** The topmost structures for the document body. *****-->
|
||||||
|
|
||||||
|
<!-- Unnumbered parts appearing in the front, such as a preface. -->
|
||||||
|
<!ELEMENT front (contents?, chapter*)>
|
||||||
|
|
||||||
|
<!-- Unnumbered parts appearing in the back, such as an afterword and/or
|
||||||
|
indices.
|
||||||
|
-->
|
||||||
|
<!ELEMENT back (chapter*, index*)>
|
||||||
|
|
||||||
|
|
||||||
|
<!--***** The topmost structures for the document. *****-->
|
||||||
|
|
||||||
|
<!-- The head containing general information about the document. -->
|
||||||
|
<!ELEMENT head (title, author+, version?, date?, abstract?, copy?)>
|
||||||
|
|
||||||
|
<!-- The main part of the document. -->
|
||||||
|
<!ELEMENT body (front?, chapter+, back?)>
|
||||||
|
|
||||||
|
<!--**********-->
|
||||||
|
|
||||||
|
|
||||||
|
<!-- The entire document. -->
|
||||||
|
<!ELEMENT gsdoc (head, body)>
|
||||||
|
<!ATTLIST gsdoc
|
||||||
|
base CDATA #IMPLIED
|
||||||
|
next CDATA #IMPLIED
|
||||||
|
prev CDATA #IMPLIED
|
||||||
|
up CDATA #IMPLIED
|
||||||
|
stylesheeturl CDATA #IMPLIED
|
||||||
|
>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue