Skip to content

Instantly share code, notes, and snippets.

@felix
Created October 23, 2008 06:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felix/18936 to your computer and use it in GitHub Desktop.
Save felix/18936 to your computer and use it in GitHub Desktop.
require 'rdoc/generator/xml'
module RDoc::Generator::XML::GOTAPI
BASE_URL = %{http://merbivore.com/documentation/current/doc/rdoc/stack/classes/}
METHODS = %{
<% if classes["sections"] then %>
<% classes["sections"].each do |sections| %>
<% if sections["method_list"] then %>
<% sections["method_list"].each do |method_list| %>
<% if method_list["methods"] then %>
<% method_list["methods"].each do |methods| %>
<page title="<%= methods["name"] %>" type="method" url="} + BASE_URL + %{<%= @ancestors.join('/').concat('/') unless @ancestors.size == 0 %><%= @current %>.html#<%= methods["aref"] %>" />
<% end %><%# method_list["methods"] %>
<% end %>
<% end %><%# sections["method_list"] %>
<% end %>
<% end %><%# classes["sections"] %>
<% end %>
}
ONE_PAGE = %{
<pages>
<% values["classes"].each do |classes| %>
<% @ancestors = classes["full_name"].split("::") %>
<% @current = @ancestors.delete_at(-1) %>
<page title="<%= classes["full_name"] %>" type="class" url="} + BASE_URL + %{<%= @ancestors.join('/').concat('/') unless @ancestors.size == 0 %><%= @current %>.html">
} + METHODS + %{
</page>
<% end %>
</pages>
}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment