Minor fixes

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@6179 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2000-03-05 17:22:57 +00:00
parent d2d7ab2c7e
commit 6b575b7a2b
3 changed files with 158 additions and 32 deletions

View file

@ -15,6 +15,7 @@
<abstract>
This documents the GNUstep Documentation markup language and tools
</abstract>
<copy>Free Software Foundation, Inc.</copy>
</head>
<body>
@ -182,11 +183,61 @@
The title and at least one author are the only parts of the
document head that must be present.
</p>
<example>
&lt;head&gt;
&lt;title&gt;GNUstep Documentation XML markup language (GSDoc)&lt;/title&gt;
&lt;author name="Richard Frith-Macdonald"&gt;
&lt;email address="rfm@gnu.org"/&gt;
&lt;url url="http://www.gnustep.org/developers/whoiswho.html"/&gt;
&lt;desc&gt;
A person who has devotes far too much time to GNUstep development.
&lt;/desc&gt;
&lt;/author&gt;
&lt;version&gt;0.1&lt;/version&gt;
&lt;date&gt;4 march, 2000&lt;/date&gt;
&lt;abstract&gt;
This documents the GNUstep Documentation markup language and tools
&lt;/abstract&gt;
&lt;copy&gt;Free Software Foundation, Inc.&lt;/copy&gt;
&lt;/head&gt;
</example>
<p>
The above axample shows all the elements possible in a document head -
</p>
<deflist>
<term><label id="title">title</label></term>
<desc>
The title of the document.
</desc>
<term><label id="author">author</label></term>
<desc>
<p>
The author of the document, also specifying an email address at
which the author may be reached, a URL for a web page giving
some information about the author, and an additional description
of the author.
</p>
<p>
Of course, a document may have more than one author, in which
case you simply write multiple author elements.
</p>
</desc>
<term><label id="version">version</label></term>
<desc>
The version number of the document.
</desc>
<term><label id="date">date</label></term>
<desc>
The date at which the document was last modified.
</desc>
<term><label id="abstract">abstract</label></term>
<desc>
A <em>short</em> description of the document contents.
</desc>
<term><label id="copy">copy</label></term>
<desc>
The copyright owner of the document.
</desc>
</deflist>
</section>
<section id="body">

View file

@ -15,6 +15,7 @@
<blockquote>
This documents the GNUstep Documentation markup language and tools
</blockquote>
<p>Copyright: Free Software Foundation, Inc.</p>
<h1>Contents</h1>
<ul>
<li><a href="#cont-0">Introduction</a>
@ -156,6 +157,12 @@
format, the outut file name should be based on this - eg.
if the base name of a document is <em>foo</em> then an html
output for this file would be <em>foo.html</em>.
<em>foo</em> then an html
output for this file would be <em>foo.html</em>.
then an html
output for this file would be <em>foo.html</em>.
<em>foo.html</em>.
.
<dt>prev
<dd>
@ -192,11 +199,74 @@
The title and at least one author are the only parts of the
document head that must be present.
</p>
<a name="label-1">example</a>
<pre>
&#60;head>
&#60;title>GNUstep Documentation XML markup language (GSDoc)&#60;/title>
&#60;author name="Richard Frith-Macdonald">
&#60;email address="rfm@gnu.org"/>
&#60;url url="http://www.gnustep.org/developers/whoiswho.html"/>
&#60;desc>
A person who has devotes far too much time to GNUstep development.
&#60;/desc>
&#60;/author>
&#60;version>0.1&#60;/version>
&#60;date>4 march, 2000&#60;/date>
&#60;abstract>
This documents the GNUstep Documentation markup language and tools
&#60;/abstract>
&#60;copy>Free Software Foundation, Inc.&#60;/copy>
&#60;/head>
</pre>
<p>
The above axample shows all the elements possible in a document head -
</p>
<dl>
<dt><a name="title">title</a>
<dd>
The title of the document.
<dt><a name="author">author</a>
<dd>
<p>
The author of the document, also specifying an email address at
which the author may be reached, a URL for a web page giving
some information about the author, and an additional description
of the author.
</p>
<p>
Of course, a document may have more than one author, in which
case you simply write multiple author elements.
</p>
<dt><a name="version">version</a>
<dd>
The version number of the document.
<dt><a name="date">date</a>
<dd>
The date at which the document was last modified.
<dt><a name="abstract">abstract</a>
<dd>
A <em>short</em> description of the document contents.
<em>short</em> description of the document contents.
description of the document contents.
<dt><a name="copy">copy</a>
<dd>
The copyright owner of the document.
</dl>
<h3><a name="body">The document body</a></h3>
<p>

View file

@ -1224,42 +1224,47 @@ loader(const char *url, const char* eid, xmlParserCtxtPtr *ctxt)
- (NSString*) parseDesc: (xmlNodePtr)node
{
NSMutableString *text = [NSMutableString string];
node = node->childs;
if (node == 0)
{
return @"";
}
if (strcmp(node->name, "list") == 0
|| strcmp(node->name, "enum") == 0
|| strcmp(node->name, "deflist") == 0
|| strcmp(node->name, "qalist") == 0)
while (node != 0)
{
return [self parseList: node];
}
if (strcmp(node->name, "p") == 0)
{
NSString *elem = [self parseText: node->childs];
if (elem == nil)
if (strcmp(node->name, "list") == 0
|| strcmp(node->name, "enum") == 0
|| strcmp(node->name, "deflist") == 0
|| strcmp(node->name, "qalist") == 0)
{
return nil;
[text appendString: [self parseList: node]];
}
return [NSString stringWithFormat: @"<p>\r\n%@</p>\r\n", elem];
}
else if (strcmp(node->name, "p") == 0)
{
NSString *elem = [self parseText: node->childs];
if (strcmp(node->name, "example") == 0)
{
return [self parseExample: node];
}
if (elem != nil)
{
[text appendFormat: @"<p>\r\n%@</p>\r\n", elem];
}
}
else if (strcmp(node->name, "example") == 0)
{
[text appendString: [self parseExample: node]];
}
else if (strcmp(node->name, "embed") == 0)
{
[text appendString: [self parseEmbed: node]];
}
else
{
[text appendString: [self parseText: node]];
}
if (strcmp(node->name, "embed") == 0)
{
return [self parseEmbed: node];
node = node->next;
}
return [self parseText: node];
return text;
}
- (NSString*) parseDocument
@ -1484,13 +1489,6 @@ loader(const char *url, const char* eid, xmlParserCtxtPtr *ctxt)
[text appendFormat: @"<p>Date: %@</p>\r\n", date];
}
if (node != 0 && strcmp(node->name, "copy") == 0)
{
copyright = [self parseText: node->childs];
node = node->next;
[text appendFormat: @"<p>Copyright: %@</p>\r\n", copyright];
}
if (node != 0 && strcmp(node->name, "abstract") == 0)
{
abstract = [self parseText: node->childs];
@ -1498,6 +1496,13 @@ loader(const char *url, const char* eid, xmlParserCtxtPtr *ctxt)
[text appendFormat: @"<blockquote>%@</blockquote>\r\n", abstract];
}
if (node != 0 && strcmp(node->name, "copy") == 0)
{
copyright = [self parseText: node->childs];
node = node->next;
[text appendFormat: @"<p>Copyright: %@</p>\r\n", copyright];
}
return text;
}