From 57e18459fe2e5e1a5c5700893e5ef22e194df481 Mon Sep 17 00:00:00 2001 From: dave Date: Tue, 20 Jan 2004 05:04:31 +0000 Subject: Document lib/English. Add top-level aliases to rdoc html output git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5512 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rdoc/generators/html_generator.rb | 12 ++++++-- lib/rdoc/generators/template/html/html.rb | 16 +++++++++- lib/rdoc/generators/template/html/old_html.rb | 44 ++------------------------- lib/rdoc/parsers/parse_rb.rb | 1 + 4 files changed, 28 insertions(+), 45 deletions(-) (limited to 'lib/rdoc') diff --git a/lib/rdoc/generators/html_generator.rb b/lib/rdoc/generators/html_generator.rb index b5e8f24e4..994d74b10 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 8ac631490..16955f550 100644 --- a/lib/rdoc/generators/template/html/html.rb +++ b/lib/rdoc/generators/template/html/html.rb @@ -324,9 +324,21 @@ IF:aliases

External Aliases

+ START:aliases - %old_name% -> %new_name%
+ + + + + +IF:desc + + + + +ENDIF:desc END:aliases +
%old_name%->%new_name%
 %desc%
ENDIF:aliases @@ -630,6 +642,8 @@ INDEX = %{ } + 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 3398dc808..de19b6696 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 = %{ - - - - %title% - - - -START:files -

File: %short_name%

- - - -
Path:%full_path%
Modified:%dtm_modified%
-} + CONTENTS_XML + %{ -END:files - -IF:classes -

Classes

-START:classes -IF:parent -

%classmod% %full_name% < HREF:par_url:parent:

-ENDIF:parent -IFNOT:parent -

%classmod% %full_name%

-ENDIF:parent - -IF:infiles -(in files -START:infiles -HREF:full_path_url:full_path: -END:infiles -) -ENDIF:infiles -} + CONTENTS_XML + %{ -END:classes -ENDIF:classes - - -} 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 d05082991..413167a39 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 -- cgit