summaryrefslogtreecommitdiff
path: root/lib/rdoc/generator/texinfo
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rdoc/generator/texinfo')
-rw-r--r--lib/rdoc/generator/texinfo/class.texinfo.erb44
-rw-r--r--lib/rdoc/generator/texinfo/file.texinfo.erb6
-rw-r--r--lib/rdoc/generator/texinfo/method.texinfo.erb6
-rw-r--r--lib/rdoc/generator/texinfo/texinfo.erb28
4 files changed, 84 insertions, 0 deletions
diff --git a/lib/rdoc/generator/texinfo/class.texinfo.erb b/lib/rdoc/generator/texinfo/class.texinfo.erb
new file mode 100644
index 0000000000..07f17eaef2
--- /dev/null
+++ b/lib/rdoc/generator/texinfo/class.texinfo.erb
@@ -0,0 +1,44 @@
+@node <%= @v['class']['full_name'].gsub(/::/, '-') %>
+@chapter <%= @v['class']["classmod"] %> <%= @v['class']['full_name'] %>
+
+<% if @v['class']["parent"] and @v['class']['par_url'] %>
+Inherits <%= href @v['class']["par_url"], @v['class']["parent"] %><% end %>
+
+<%= @v['class']["description"] %>
+
+<% if @v['class']["includes"] %>
+Includes
+<% @v['class']["includes"].each do |include| %>
+* <%= href include["aref"], include["name"] %>
+<% end # @v['class']["includes"] %>
+<% end %>
+
+<% if @v['class']["sections"] %>
+<% @v['class']["sections"].each do |section| %>
+<% if section["attributes"] %>
+Attributes
+<% section["attributes"].each do |attributes| %>
+* <%= attributes["name"] %> <%= attributes["rw"] %> <%= attributes["a_desc"] %>
+<% end # section["attributes"] %>
+<% end %>
+<% end %>
+
+<% @v['class']["sections"].each do |section| %>
+<% if section["method_list"] %>
+Methods
+@menu
+<% section["method_list"].each_with_index do |method_list, i| %>
+<%= i %>
+<% (method_list["methods"] || []).each do |method| %>
+* <%= @v['class']['full_name'].gsub(/::/, '-') %><%= method_prefix method_list %><%= method['name'] %>::<% end %>
+<% end %>
+@end menu
+
+<% section["method_list"].each do |method_list| %>
+<% (method_list["methods"] || []).uniq.each do |method| %>
+<%= TexinfoTemplate.new(@v.merge({'method' => method, 'list' => method_list}),
+ 'method.texinfo.erb').render %><% end %>
+<% end # section["method_list"] %>
+<% end %>
+<% end # @v['class']["sections"] %>
+<% end %>
diff --git a/lib/rdoc/generator/texinfo/file.texinfo.erb b/lib/rdoc/generator/texinfo/file.texinfo.erb
new file mode 100644
index 0000000000..b619b94bd2
--- /dev/null
+++ b/lib/rdoc/generator/texinfo/file.texinfo.erb
@@ -0,0 +1,6 @@
+<% if false %>
+<h2>File: <%= @v['file']["short_name"] %></h2>
+Path: <%= @v['file']["full_path"] %>
+
+<%= TexinfoTemplate.new(@v, 'content.texinfo.erb').render %>
+<% end %>
diff --git a/lib/rdoc/generator/texinfo/method.texinfo.erb b/lib/rdoc/generator/texinfo/method.texinfo.erb
new file mode 100644
index 0000000000..f5c2b73a4b
--- /dev/null
+++ b/lib/rdoc/generator/texinfo/method.texinfo.erb
@@ -0,0 +1,6 @@
+@node <%= @v['class']['full_name'].gsub(/::/, '-') %><%= method_prefix @v['list'] %><%= @v['method']['name'] %>
+@section <%= @v['class']["classmod"] %> <%= @v['class']['full_name'] %><%= method_prefix @v['list'] %><%= @v['method']['name'] %>
+<%= @v['method']["type"] %> <%= @v['method']["category"] %> method:
+<%= target @v['method']["aref"], @v['method']['callseq'] ||
+ @v['method']["name"] + @v['method']["params"] %>
+<%= @v['method']["m_desc"] %>
diff --git a/lib/rdoc/generator/texinfo/texinfo.erb b/lib/rdoc/generator/texinfo/texinfo.erb
new file mode 100644
index 0000000000..235f63d73c
--- /dev/null
+++ b/lib/rdoc/generator/texinfo/texinfo.erb
@@ -0,0 +1,28 @@
+\input texinfo @c -*-texinfo-*-
+@c %**start of header
+@setfilename <%= @v['filename'] %>
+@settitle <%= @v['title'] %>
+@c %**end of header
+
+@contents @c TODO: whitespace is a mess... =\
+
+@ifnottex
+@node Top
+
+@top <%= @v['title'] %>
+@end ifnottex
+
+<% if @f = @v['files'].detect { |f| f.name =~ /Readme/i } %>
+<%= @f.values['description'] %><% end %>
+
+@menu
+<% @v['classes'].each do |klass| %>
+* <%= klass.name.gsub(/::/, '-') %>::<% end %>
+@c TODO: add files
+@end menu
+
+<% (@v['classes'] || []).each_with_index do |klass, i| %>
+<%= TexinfoTemplate.new(@v.merge('class' => klass.values),
+ 'class.texinfo.erb').render %><% end %>
+
+@bye