zapnap / rdocinfo

New development has moved to http://github.com/lsegal/rubydoc.info
http://rdoc.info
MIT License
18 stars 3 forks source link

Direct linking to documentation for a class #32

Open wvanbergen opened 14 years ago

wvanbergen commented 14 years ago

I would like to be able to link to a certain namespace directly from an external site. For instance, I would like to add a link to the Adyen::Form documentation from the project's wiki on Github.

The direct link for this currently is http://rdoc.info/rdoc/wvanbergen/adyen/blob/059d0cf66f2c234b832bd3869dfa126865f46fed/Adyen/Form.html However, as far as I can see this link is updated every time the documentation is regenerated, which requires me to update the direct links. Is there a way to offer a more permantent link to this page from an external site?

zapnap commented 14 years ago

Yeah, we don't support direct links right now. Since a method or class may be removed / added to any revision of a project I imagine that this could be slightly complicated (for thoroughness / posterity). Happy to listen to suggestions though, and of course accept reasonable patches!

wvanbergen commented 14 years ago

Maybe add a "latest" symlink to the latest sha for the project, e.g. /blob/latest/Adyen/Form.html

Otherwise, a Javascript approach that uses the hash-portion of the URL to display the correct page would be an idea, e.g. http://rdoc.info/rdoc/wvanbergen/adyen/#Adyen::Form

I am willing to try to implement something like this if you like one of these approaches.

zapnap commented 14 years ago

Either approach is valid, I think. An ideal solution would preserve the top-frame too, for nav reasons (ex: use the /projects path instead of the /rdoc static documents path). Given how those paths are constructed, I'd probably say that a JavaScript-based solution would be best.

MikeTaylor commented 14 years ago

I really, really want this -- any of the solutions is fine, but wvanbergen's is my favourite. Maybe it should be called HEAD rather than latest?

visoft commented 14 years ago

This would be extremely helpful; I also like wvanbergen's solution.