1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/rdoc/diagram.rb:

- properly quote bare element attributes
    - terminates dangling elements (e.g. <img>, <br>, <link>, etc)
    - converts "CVS" to the more HTML-friendly acronym element
    - adds missing type attributes to style elements

  based on Paul Duncan's patch <pabs@pablotron.org> [ruby-core:7028]

* lib/rdoc/generators/html_generator.rb: ditto.
* lib/rdoc/generators/template/html/hefss.rb: ditto.
* lib/rdoc/generators/template/html/html.rb: ditto.
* lib/rdoc/generators/template/html/kilmer.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9828 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ocean 2006-01-13 10:27:52 +00:00
parent 50371feb52
commit 1383c1eb2d
7 changed files with 75 additions and 60 deletions

View file

@ -1,3 +1,18 @@
Fri Jan 13 19:14:56 2006 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* lib/rdoc/diagram.rb:
- properly quote bare element attributes
- terminates dangling elements (e.g. <img>, <br>, <link>, etc)
- converts "CVS" to the more HTML-friendly acronym element
- adds missing type attributes to style elements
based on Paul Duncan's patch <pabs@pablotron.org> [ruby-core:7028]
* lib/rdoc/generators/html_generator.rb: ditto.
* lib/rdoc/generators/template/html/hefss.rb: ditto.
* lib/rdoc/generators/template/html/html.rb: ditto.
* lib/rdoc/generators/template/html/kilmer.rb: ditto.
Thu Jan 12 11:53:08 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
* ext/tk/sample/tkballoonhelp.rb: [bug fix] couldn't add to a widget

View file

@ -320,13 +320,13 @@ module RDoc
xs, ys = [$1.to_i, $3.to_i], [$2.to_i, $4.to_i]
url, area_name = $5, $6
res << %{ <area shape="RECT" coords="#{xs.min},#{ys.min},#{xs.max},#{ys.max}" }
res << %{ href="#{url}" alt="#{area_name}">\n}
res << %{ <area shape="rect" coords="#{xs.min},#{ys.min},#{xs.max},#{ys.max}" }
res << %{ href="#{url}" alt="#{area_name}" />\n}
end
res << "</map>\n"
# map_file = src.sub(/.dot/, '.map')
# system("dot -Timap #{src} -o #{map_file}")
res << %{<img src="#{dot}" usemap="#map" border=0 alt="#{name}">}
res << %{<img src="#{dot}" usemap="#map" border="0" alt="#{name}" />}
return res
end
end

View file

@ -153,7 +153,7 @@ module Generators
if (type == "http" || type == "link") &&
url =~ /\.(gif|png|jpg|jpeg|bmp)$/
"<img src=\"#{url}\">"
"<img src=\"#{url}\" />"
else
"<a href=\"#{url}\">#{text.sub(%r{^#{type}:/*}, '')}</a>"
end

View file

@ -114,7 +114,7 @@ BODY = %{
<html><head>
<title>%title%</title>
<meta http-equiv="Content-Type" content="text/html; charset=%charset%">
<link rel=StyleSheet href="%style_url%" type="text/css" media=screen>
<link rel="stylesheet" href="%style_url%" type="text/css" media="screen" />
<script type="text/javascript" language="JavaScript">
<!--
function popCode(url) {
@ -138,9 +138,9 @@ IF:description
ENDIF:description
IF:requires
<table cellpadding=5 width="100%">
<table cellpadding="5" width="100%">
<tr><td class="tablesubtitle">Required files</td></tr>
</table><br>
</table><br />
<div class="name-list">
START:requires
HREF:aref:name:
@ -149,9 +149,9 @@ ENDIF:requires
</div>
IF:methods
<table cellpadding=5 width="100%">
<table cellpadding="5" width="100%">
<tr><td class="tablesubtitle">Subroutines and Functions</td></tr>
</table><br>
</table><br />
<div class="name-list">
START:methods
HREF:aref:name:,
@ -160,10 +160,10 @@ END:methods
ENDIF:methods
IF:attributes
<table cellpadding=5 width="100%">
<table cellpadding="5" width="100%">
<tr><td class="tablesubtitle">Arguments</td></tr>
</table><br>
<table cellspacing=5>
</table><br />
<table cellspacing="5">
START:attributes
<tr valign="top">
IF:rw
@ -180,10 +180,10 @@ END:attributes
ENDIF:attributes
IF:classlist
<table cellpadding=5 width="100%">
<table cellpadding="5" width="100%">
<tr><td class="tablesubtitle">Modules</td></tr>
</table><br>
%classlist%<br>
</table><br />
%classlist%<br />
ENDIF:classlist
!INCLUDE! <!-- method descriptions -->
@ -198,13 +198,13 @@ FILE_PAGE = <<_FILE_PAGE_
<table width="100%">
<tr class="title-row">
<td><table width="100%"><tr>
<td class="big-title-font" colspan=2><font size=-3><B>File</B><BR></font>%short_name%</td>
<td align="right"><table cellspacing=0 cellpadding=2>
<td class="big-title-font" colspan="2"><font size="-3"><b>File</b><br /></font>%short_name%</td>
<td align="right"><table cellspacing="0" cellpadding="2">
<tr>
<td class="small-title-font">Path:</td>
<td class="small-title-font">%full_path%
IF:cvsurl
&nbsp;(<a href="%cvsurl%">CVS</a>)
&nbsp;(<a href="%cvsurl%"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
ENDIF:cvsurl
</td>
</tr>
@ -215,26 +215,26 @@ ENDIF:cvsurl
</table>
</td></tr></table></td>
</tr>
</table><br>
</table><br />
_FILE_PAGE_
###################################################################
CLASS_PAGE = %{
<table width="100%" border=0 cellspacing=0>
<table width="100%" border="0" cellspacing="0">
<tr class="title-row">
<td class="big-title-font">
<font size=-3><B>%classmod%</B><BR></font>%full_name%
<font size="-3"><b>%classmod%</b><br /></font>%full_name%
</td>
<td align="right">
<table cellspacing=0 cellpadding=2>
<table cellspacing="0" cellpadding="2">
<tr valign="top">
<td class="small-title-font">In:</td>
<td class="small-title-font">
START:infiles
HREF:full_path_url:full_path:
IF:cvsurl
&nbsp;(<a href="%cvsurl%">CVS</a>)
&nbsp;(<a href="%cvsurl%"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
ENDIF:cvsurl
END:infiles
</td>
@ -256,14 +256,14 @@ ENDIF:parent
</table>
</td>
</tr>
</table><br>
</table><br />
}
###################################################################
METHOD_LIST = %{
IF:includes
<div class="tablesubsubtitle">Uses</div><br>
<div class="tablesubsubtitle">Uses</div><br />
<div class="name-list">
START:includes
<span class="method-name">HREF:aref:name:</span>
@ -274,11 +274,11 @@ ENDIF:includes
IF:method_list
START:method_list
IF:methods
<table cellpadding=5 width="100%">
<table cellpadding="5" width="100%">
<tr><td class="tablesubtitle">%type% %category% methods</td></tr>
</table>
START:methods
<table width="100%" cellspacing = 0 cellpadding=5 border=0>
<table width="100%" cellspacing="0" cellpadding="5" border="0">
<tr><td class="methodtitle">
<a name="%aref%">
<b>%name%</b>%params%
@ -307,7 +307,7 @@ SRC_PAGE = %{
<html>
<head><title>%title%</title>
<meta http-equiv="Content-Type" content="text/html; charset=%charset%">
<style>
<style type="text/css">
.kw { color: #3333FF; font-weight: bold }
.cmt { color: green; font-style: italic }
.str { color: #662222; font-style: italic }
@ -339,7 +339,7 @@ FILE_INDEX = %{
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=%charset%">
<style>
<style type="text/css">
<!--
body {
background-color: #bbbbbb;
@ -368,7 +368,7 @@ div.banner {
<body>
<div class="banner">%list_title%</div>
START:entries
<a href="%href%">%name%</a><br>
<a href="%href%">%name%</a><br />
END:entries
</body></html>
}

View file

@ -322,7 +322,7 @@ FILE_PAGE = %{
<td><strong>Path:</strong></td>
<td>%full_path%
IF:cvsurl
&nbsp;(<a href="%cvsurl%">CVS</a>)
&nbsp;(<a href="%cvsurl%"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
ENDIF:cvsurl
</td>
</tr>
@ -358,7 +358,7 @@ IF:full_path_url
</a>
ENDIF:full_path_url
IF:cvsurl
&nbsp;(<a href="%cvsurl%">CVS</a>)
&nbsp;(<a href="%cvsurl%"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
ENDIF:cvsurl
<br />
END:infiles
@ -504,7 +504,7 @@ IF:aliases
START:aliases
<tr class="top-aligned-row context-row">
<td class="context-item-name">%old_name%</td>
<td>-></td>
<td>-&gt;</td>
<td class="context-item-value">%new_name%</td>
</tr>
IF:desc

View file

@ -94,7 +94,7 @@ BODY = %{
<html><head>
<title>%title%</title>
<meta http-equiv="Content-Type" content="text/html; charset=%charset%">
<link rel=StyleSheet href="%style_url%" type="text/css" media=screen>
<link rel="stylesheet" href="%style_url%" type="text/css" media="screen" />
<script type="text/javascript" language="JavaScript">
<!--
function popCode(url) {
@ -118,9 +118,9 @@ IF:description
ENDIF:description
IF:requires
<table cellpadding=5 width="100%">
<table cellpadding="5" width="100%">
<tr><td class="tablesubtitle">Required files</td></tr>
</table><br>
</table><br />
<div class="name-list">
START:requires
HREF:aref:name:
@ -129,9 +129,9 @@ ENDIF:requires
</div>
IF:methods
<table cellpadding=5 width="100%">
<table cellpadding="5" width="100%">
<tr><td class="tablesubtitle">Methods</td></tr>
</table><br>
</table><br />
<div class="name-list">
START:methods
HREF:aref:name:,
@ -152,10 +152,10 @@ ENDIF:seccomment
ENDIF:sectitle
IF:attributes
<table cellpadding=5 width="100%">
<table cellpadding="5" width="100%">
<tr><td class="tablesubtitle">Attributes</td></tr>
</table><br>
<table cellspacing=5>
</table><br />
<table cellspacing="5">
START:attributes
<tr valign="top">
IF:rw
@ -172,10 +172,10 @@ END:attributes
ENDIF:attributes
IF:classlist
<table cellpadding=5 width="100%">
<table cellpadding="5" width="100%">
<tr><td class="tablesubtitle">Classes and Modules</td></tr>
</table><br>
%classlist%<br>
</table><br />
%classlist%<br />
ENDIF:classlist
!INCLUDE! <!-- method descriptions -->
@ -192,13 +192,13 @@ FILE_PAGE = <<_FILE_PAGE_
<table width="100%">
<tr class="title-row">
<td><table width="100%"><tr>
<td class="big-title-font" colspan=2><font size=-3><B>File</B><BR></font>%short_name%</td>
<td align="right"><table cellspacing=0 cellpadding=2>
<td class="big-title-font" colspan="2"><font size="-3"><b>File</b><br /></font>%short_name%</td>
<td align="right"><table cellspacing="0" cellpadding="2">
<tr>
<td class="small-title-font">Path:</td>
<td class="small-title-font">%full_path%
IF:cvsurl
&nbsp;(<a href="%cvsurl%">CVS</a>)
&nbsp;(<a href="%cvsurl%"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
ENDIF:cvsurl
</td>
</tr>
@ -209,26 +209,26 @@ ENDIF:cvsurl
</table>
</td></tr></table></td>
</tr>
</table><br>
</table><br />
_FILE_PAGE_
###################################################################
CLASS_PAGE = %{
<table width="100%" border=0 cellspacing=0>
<table width="100%" border="0" cellspacing="0">
<tr class="title-row">
<td class="big-title-font">
<font size=-3><B>%classmod%</B><BR></font>%full_name%
<font size="-3"><b>%classmod%</b><br /></font>%full_name%
</td>
<td align="right">
<table cellspacing=0 cellpadding=2>
<table cellspacing="0" cellpadding="2">
<tr valign="top">
<td class="small-title-font">In:</td>
<td class="small-title-font">
START:infiles
HREF:full_path_url:full_path:
IF:cvsurl
&nbsp;(<a href="%cvsurl%">CVS</a>)
&nbsp;(<a href="%cvsurl%"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
ENDIF:cvsurl
END:infiles
</td>
@ -250,14 +250,14 @@ ENDIF:parent
</table>
</td>
</tr>
</table><br>
</table><br />
}
###################################################################
METHOD_LIST = %{
IF:includes
<div class="tablesubsubtitle">Included modules</div><br>
<div class="tablesubsubtitle">Included modules</div><br />
<div class="name-list">
START:includes
<span class="method-name">HREF:aref:name:</span>
@ -272,7 +272,7 @@ IF:methods
<tr><td class="tablesubtitle">%type% %category% methods</td></tr>
</table>
START:methods
<table width="100%" cellspacing = 0 cellpadding=5 border=0>
<table width="100%" cellspacing="0" cellpadding="5" border="0">
<tr><td class="methodtitle">
<a name="%aref%">
IF:callseq
@ -319,7 +319,7 @@ SRC_PAGE = %{
<html>
<head><title>%title%</title>
<meta http-equiv="Content-Type" content="text/html; charset=%charset%">
<style>
<style type="text/css">
.ruby-comment { color: green; font-style: italic }
.ruby-constant { color: #4433aa; font-weight: bold; }
.ruby-identifier { color: #222222; }
@ -380,7 +380,7 @@ div.banner {
<body>
<div class="banner">%list_title%</div>
START:entries
<a href="%href%">%name%</a><br>
<a href="%href%">%name%</a><br />
END:entries
</body></html>
}

View file

@ -497,7 +497,7 @@ FILE_PAGE = <<_FILE_PAGE_
<td class="small-title-font">Path:</td>
<td class="small-title-font">%full_path%
IF:cvsurl
&nbsp;(<a href="%cvsurl%">CVS</a>)
&nbsp;(<a href="%cvsurl%"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
ENDIF:cvsurl
</td>
</tr>
@ -533,7 +533,7 @@ IF:full_path_url
</a>
ENDIF:full_path_url
IF:cvsurl
&nbsp;(<a href="%cvsurl%">CVS</a>)
&nbsp;(<a href="%cvsurl%"><acronym title="Concurrent Versioning System">CVS</acronym></a>)
ENDIF:cvsurl
<br />
END:infiles
@ -570,7 +570,7 @@ SRC_PAGE = %{
<head>
<meta http-equiv="Content-Type" content="text/html; charset=%charset%">
<title>%title%</title>
<link rel=StyleSheet href="%style_url%" type="text/css" media="screen" />
<link rel="stylesheet" href="%style_url%" type="text/css" media="screen" />
</head>
<body bgcolor="white">
<pre>%code%</pre>