Skip to content

Commit

Permalink
Merge pull request #430 from gnustep/agsdoc_new_style
Browse files Browse the repository at this point in the history
Style HR bars with CSS and not inline.
  • Loading branch information
rmottola authored Aug 8, 2024
2 parents 3fb7647 + db2f554 commit ea9c40e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
32 changes: 20 additions & 12 deletions Tools/AGSHtml.m
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf
}
else if ([name isEqual: @"br"] == YES)
{
[buf appendString: @"<br />"];
[buf appendString: @"<br/>"];
}
else if ([name isEqual: @"category"] == YES)
{
Expand Down Expand Up @@ -1023,7 +1023,7 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf
[buf appendString: @"</h3>\n"];
[buf appendString: indent];
[buf appendString: str];
[buf appendString: @";<br />\n"];
[buf appendString: @";<br/>\n"];

node = firstElement(children);

Expand All @@ -1046,7 +1046,7 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf
}

[buf appendString: indent];
[buf appendString: @"<hr width=\"25%\" align=\"left\" />\n"];
[buf appendString: @"<hr class=\"method-separator\">\n"];
}
else if ([name isEqual: @"contents"] == YES)
{
Expand Down Expand Up @@ -1359,7 +1359,7 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf
}

[buf appendString: indent];
[buf appendString: @"<hr width=\"25%\" align=\"left\" />\n"];
[buf appendString: @"<hr class=\"method-separator\">\n"];
}
else if ([name isEqual: @"gsdoc"] == YES)
{
Expand Down Expand Up @@ -1402,6 +1402,14 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf
[self outputText: [children firstChild] to: buf];
[self decIndent];
[buf appendString: @"</title>\n"];

/** handcrafted styles for previous in-line styles */
[buf appendString: indent];
[buf appendString: @"<style type=\"text/css\">\n"];
[buf appendString: indent];
[buf appendString: @"hr.method-separator { width:25%; margin-left:0; }\n"];
[buf appendString: indent];
[buf appendString: @"</style>\n"];
#if 0
/** Css : TODO print.css **/
[buf appendString:@"<meta http-equiv=\"Content-Style-Type\" content=\"text/css\"/>\n"];
Expand Down Expand Up @@ -1674,7 +1682,7 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf
}

[buf appendString: indent];
[buf appendString: @"<hr width=\"25%\" align=\"left\" />\n"];
[buf appendString: @"<hr class=\"method-separator\"/>\n"];
}
else if ([name isEqual: @"label"] == YES) // %anchor
{
Expand Down Expand Up @@ -1803,7 +1811,7 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf
}

[buf appendString: indent];
[buf appendString: @"<hr width=\"25%\" align=\"left\" />\n"];
[buf appendString: @"<hr class=\"method-separator\"/>\n"];
}
else if ([name isEqual: @"method"] == YES)
{
Expand Down Expand Up @@ -1969,7 +1977,7 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf
[self outputNode: node to: buf];
}
[buf appendString: indent];
[buf appendString: @"<hr width=\"25%\" align=\"left\" />\n"];
[buf appendString: @"<hr class=\"method-separator\"/>\n"];
}
[buf appendString:@"</div>\n"];
}
Expand Down Expand Up @@ -2166,7 +2174,7 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf
}

[buf appendString: indent];
[buf appendString: @"<hr width=\"25%\" align=\"left\" />\n"];
[buf appendString: @"<hr class=\"method-separator\"/>\n"];
}
else if ([name isEqual: @"uref"] == YES)
{
Expand Down Expand Up @@ -2221,7 +2229,7 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf
[buf appendString: @"</h3>\n"];
[buf appendString: indent];
[buf appendString: str];
[buf appendString: @";<br />\n"];
[buf appendString: @";<br/>\n"];

node = firstElement(children);

Expand All @@ -2244,7 +2252,7 @@ - (void) outputNode: (GSXMLNode*)node to: (NSMutableString*)buf
}

[buf appendString: indent];
[buf appendString: @"<hr width=\"25%\" align=\"left\" />\n"];
[buf appendString: @"<hr class=\"method-separator\"/>\n"];
}
else
{
Expand Down Expand Up @@ -2833,14 +2841,14 @@ - (void) outputVersion: (NSDictionary*)prop to: (NSMutableString*)buf
[buf appendString: @" deprecated at "];
[buf appendString: gvdep];
}
[buf appendString: @"<br />\n"];
[buf appendString: @"<br/>\n"];
if ([gvrem length] > 0)
{
[buf appendString: @" Likely to be changed/moved/removed at "];
[buf appendString: gvrem];
}
[buf appendString:@"</div>\n"];
[buf appendString: @"<br />\n"];
[buf appendString: @"<br/>\n"];
}
}

Expand Down
5 changes: 2 additions & 3 deletions Tools/autogsdoc.m
Original file line number Diff line number Diff line change
Expand Up @@ -1978,8 +1978,7 @@ 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"
@" <FONT FACE=\"sans\" SIZE=\"+1\"><B>Index</B></FONT><BR/><BR/>\n"
@" <FONT FACE=\"sans\" SIZE=\"-1\">"];
@" <B>Index</B><BR/>\n"];

// this becomes index.html
framesetFile = [@"index" stringByAppendingPathExtension: @"html"];
Expand Down Expand Up @@ -2041,7 +2040,7 @@ standard PropertyList format (not the XML format of OS X), using
[idxIndex appendFormat:
@"&nbsp;(<A HREF=\"%@.html\" TARGET=\"_top\">unframe</A>)\n",
project];
[idxIndex appendString: @" </FONT>\n </BODY>\n</HTML>\n"];
[idxIndex appendString: @" </BODY>\n</HTML>\n"];
[idxIndex writeToFile:
[documentationDirectory stringByAppendingPathComponent: idxIndexFile]
atomically: YES];
Expand Down

0 comments on commit ea9c40e

Please sign in to comment.