rdoc/ri feature request

J

John Joyce

I know it's selfish, but...
I would like rdoc to have the ability to build a landing page/portal
locally accessible in a browser.
That way there would be quick, easy to navigate docs available from
one aggregate place.
In addition to this, the ability to configure it to rebuild at
intervals/events. For example, after a gem is installed, or every
Monday morning at 3:00 would be convenient. Ideally, this would be
daemonized and maybe simply take advantage of platform-available
tools (such as chron on *nix's and whatever is available on Windows).
 
J

Joel VanderWerf

John said:
I know it's selfish, but...
I would like rdoc to have the ability to build a landing page/portal
locally accessible in a browser.
That way there would be quick, easy to navigate docs available from one
aggregate place.
In addition to this, the ability to configure it to rebuild at
intervals/events. For example, after a gem is installed, or every Monday
morning at 3:00 would be convenient. Ideally, this would be daemonized
and maybe simply take advantage of platform-available tools (such as
chron on *nix's and whatever is available on Windows).

There's the gem server ("gem help server" for details), but I prefer a
static page, so I just do the following after updating or installing
gems and cleanup:

$ cat gem-update-docs
#!/usr/bin/env ruby

require "amrita/template"
include Amrita

Dir.chdir "/usr/local/lib/ruby/gems/1.8/doc"

tmpl = TemplateText.new <<END
<title>Gem Docs</title>
<table border="1">
<tr><th>Name</th><th>Title</th><th>Gem Docs</tr>
<tr id=table1>
<td id="name"></td>
<td id="title"></td>
<td><a id="gemdocs"></a></td>
</tr>
</table>
END

links = Dir['*/rdoc/index.html']

linkdata = links.sort_by{|s|s.downcase}.map do |link|
{
:name => link[/(.*?)\//,1],
:title =>
File.open(link).grep(/<title>/)[0][/<title>(.*?)<\/title>/,1],
:gemdocs => a:)href=>link) { link }
}
end

data = {
:table1 => linkdata
}

tmpl.prettyprint = true
tmpl.expand(File.open("index.html", "w"), data)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,161
Messages
2,570,892
Members
47,430
Latest member
7dog123

Latest Threads

Top