summaryrefslogtreecommitdiff
path: root/lib/rdoc
diff options
context:
space:
mode:
authordave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-01-20 05:04:31 +0000
committerdave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-01-20 05:04:31 +0000
commitf8c7b41165042b3d398a6a237aac9207e2856aea (patch)
treeb01cb76346976634e3a22156405100299a5dc812 /lib/rdoc
parentc354e35d79c955f1d39e52560655f46f86209110 (diff)
Document lib/English. Add top-level aliases to rdoc html output
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc')
-rw-r--r--lib/rdoc/generators/html_generator.rb12
-rw-r--r--lib/rdoc/generators/template/html/html.rb16
-rw-r--r--lib/rdoc/generators/template/html/old_html.rb44
-rw-r--r--lib/rdoc/parsers/parse_rb.rb1
4 files changed, 28 insertions, 45 deletions
diff --git a/lib/rdoc/generators/html_generator.rb b/lib/rdoc/generators/html_generator.rb
index b5e8f24e43..994d74b103 100644
--- a/lib/rdoc/generators/html_generator.rb
+++ b/lib/rdoc/generators/html_generator.rb
@@ -326,13 +326,18 @@ module Generators
end
- # Build a list of aliases fo which we couldn't find a corresponding method
+ # Build a list of aliases for which we couldn't find a
+ # corresponding method
def build_alias_summary_list
@context.aliases.map do |al|
- {
+ res = {
'old_name' => al.old_name,
'new_name' => al.new_name,
}
+ if al.comment && !al.comment.empty?
+ res['desc'] = markup(al.comment, true)
+ end
+ res
end
end
@@ -750,6 +755,9 @@ module Generators
co = build_constants_summary_list
@values["constants"] = co unless co.empty?
+ al = build_alias_summary_list
+ @values["aliases"] = al unless al.empty?
+
if @options.promiscuous
file_context = nil
else
diff --git a/lib/rdoc/generators/template/html/html.rb b/lib/rdoc/generators/template/html/html.rb
index 8ac631490c..16955f550a 100644
--- a/lib/rdoc/generators/template/html/html.rb
+++ b/lib/rdoc/generators/template/html/html.rb
@@ -324,9 +324,21 @@ IF:aliases
<h2 class="section-bar">External Aliases</h2>
<div class="name-list">
+ <table summary="aliases">
START:aliases
- %old_name% -> %new_name% <br />
+ <tr class="top-aligned-row context-row">
+ <td class="context-item-name">%old_name%</td>
+ <td>-></td>
+ <td class="context-item-value">%new_name%</td>
+ </tr>
+IF:desc
+ <tr class="top-aligned-row context-row">
+ <td>&nbsp;</td>
+ <td colspan="2" class="context-item-desc">%desc%</td>
+ </tr>
+ENDIF:desc
END:aliases
+ </table>
</div>
</div>
ENDIF:aliases
@@ -630,6 +642,8 @@ INDEX = %{<?xml version="1.0" encoding="%charset%"?>
}
+
end # module Page
end # class RDoc
+require 'rdoc/generators/template/html/one_page_html'
diff --git a/lib/rdoc/generators/template/html/old_html.rb b/lib/rdoc/generators/template/html/old_html.rb
index 3398dc808f..de19b66967 100644
--- a/lib/rdoc/generators/template/html/old_html.rb
+++ b/lib/rdoc/generators/template/html/old_html.rb
@@ -721,48 +721,8 @@ END:method_list
ENDIF:method_list
}
-########################################################################
-
-ONE_PAGE = %{
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-<head>
- <title>%title%</title>
- <meta http-equiv="Content-Type" content="text/html; charset=%charset%" />
-</head>
-<body>
-START:files
-<h2>File: %short_name%</h2>
-<table>
- <tr><td>Path:</td><td>%full_path%</td></tr>
- <tr><td>Modified:</td><td>%dtm_modified%</td></tr>
-</table>
-} + CONTENTS_XML + %{
-END:files
-
-IF:classes
-<h2>Classes</h2>
-START:classes
-IF:parent
-<h3>%classmod% %full_name% &lt; HREF:par_url:parent:</h3>
-ENDIF:parent
-IFNOT:parent
-<h3>%classmod% %full_name%</h3>
-ENDIF:parent
-
-IF:infiles
-(in files
-START:infiles
-HREF:full_path_url:full_path:
-END:infiles
-)
-ENDIF:infiles
-} + CONTENTS_XML + %{
-END:classes
-ENDIF:classes
-</body>
-</html>
-}
end
end
+
+require 'rdoc/generators/template/html/one_page_html'
diff --git a/lib/rdoc/parsers/parse_rb.rb b/lib/rdoc/parsers/parse_rb.rb
index d050829915..413167a39a 100644
--- a/lib/rdoc/parsers/parse_rb.rb
+++ b/lib/rdoc/parsers/parse_rb.rb
@@ -2313,6 +2313,7 @@ module RDoc
skip_tkspace
end
old_name = get_symbol_or_name
+
al = Alias.new(get_tkread, old_name, new_name, comment)
read_documentation_modifiers(al, ATTR_MODIFIERS)
if al.document_self