Is there any way to easily link a file in RDoc?
I want to link to a documentation of a file in RDoc. but the only way I could do is with the following markup:
configuration.rb[link:files/configuration_rb.html]
I would like to do it in a better way, something like this:
<file>configuration.rb</file>
Is there any existing markup rule to do this?
EDIT: of course I've tried without any markup like this configuration.rb
but it shows 开发者_Go百科the filename without the link :(
To display a link in rdoc
{Link label}[url ]
Sample
{Killer question}[http://http://stackoverflow.com/questions/2230954/is-there-any-way-to-easily-link-a-file-in-rdoc]
will create a link of the this question
Auto hyperlinked: MyClass my_class.rb def my_method; end; #my_method http:, mailto:, ftp:, www. link: (to local filesystem relative to --op) (urls to images are rendered as inline image tags) label[url] (uses label as hyperlink text) {multi word label}[url] (uses label as hyperlink text)
Ruby:
ClassNames, source_files.rb and either method_name_having_an_underscore or #methodnamewithhash are hyperlinked to their documentation.
It sounds like you're looking for that second one, but I've never used it before so I can't give you a fully useful example.
Try not to use markup at all.
Look at RDoc's own documentation, they have similar links in the "Roadmap" paragraph. They markup is here.
Magic!
精彩评论