12

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 the filename without the link :(

KARASZI István
  • 30,900
  • 8
  • 101
  • 128

3 Answers3

7

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

Muntasim
  • 6,689
  • 3
  • 46
  • 69
  • 2
    This doesn't answer the question. The question asks about relative links, not an external URL. In addition, what is `http://http://`? – Franklin Yu Sep 02 '16 at 18:38
2

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.

AnkitG
  • 6,438
  • 7
  • 44
  • 72
Trevoke
  • 4,115
  • 1
  • 27
  • 48
-1

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!

blinry
  • 4,746
  • 4
  • 26
  • 31