Is there any way to easily link a file in RDoc?
Asked Answered
A

3

14

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 :(

Approachable answered 9/2, 2010 at 17:9 Comment(0)
M
8

To display a link in rdoc

{Link label}[url ]

Sample

{Killer question}[http://https://mcmap.net/q/836158/-is-there-any-way-to-easily-link-a-file-in-rdoc]

will create a link of the this question

Mitsukomitt answered 6/9, 2013 at 16:9 Comment(1)
This doesn't answer the question. The question asks about relative links, not an external URL. In addition, what is http://http://?Simplex
B
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.

Bandanna answered 19/2, 2010 at 15:15 Comment(2)
Well.. I guess your last option is to add the markup you want and submit a patch? Or put in a feature request, at least.Bandanna
yeah, it looks like you're right. so right now it's not possible.Countermove
B
-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!

Bestrew answered 18/2, 2010 at 13:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.