[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

How do I use rdoc's link: hyperlinks?

Tim Hunter

10/24/2004 4:41:00 PM

I'm trying to include a hyperlink using the label[url] form, where the
hyperlink uses the link: prefix to refer to a local file. However I'm not
able to get rdoc to generate the correct href. What's the right way to do
this?
3 Answers

Joel VanderWerf

10/24/2004 6:40:00 PM

0

Tim Hunter wrote:
> I'm trying to include a hyperlink using the label[url] form, where the
> hyperlink uses the link: prefix to refer to a local file. However I'm not
> able to get rdoc to generate the correct href. What's the right way to do
> this?

Is the local file one of those generated by rdoc? This has worked for me:

doc/protocol.txt[link:files/doc/protocol_txt.html]

where my dirs are:

doc/
protocol.txt # doc source file
api/
classes/
files/
doc/
protocol_txt.html # generated by rdoc
lib/
index.html
lib/

and I run rdoc with the options

rdoc -o doc/api doc/*.txt

Seems a bit contorted, but it works :)


Tim Hunter

10/24/2004 8:18:00 PM

0

Joel VanderWerf wrote:

> Is the local file one of those generated by rdoc? This has worked for me:
>
> doc/protocol.txt[link:files/doc/protocol_txt.html]

Is there magic in the --op option? I just tried a simple test. I made a
file, rdoctest.rb, with just this line:
# label[link:doc/files/rdoctest_rb.html]

Then I ran
rdoc rdoctest.html

Rdoc created this hyperlink:
<a href="link:doc/files/rdoctest_rb.html">label</a>

Joel VanderWerf

10/24/2004 9:56:00 PM

0

Tim Hunter wrote:
> Joel VanderWerf wrote:
>
>
>>Is the local file one of those generated by rdoc? This has worked for me:
>>
>> doc/protocol.txt[link:files/doc/protocol_txt.html]
>
>
> Is there magic in the --op option? I just tried a simple test. I made a
> file, rdoctest.rb, with just this line:
> # label[link:doc/files/rdoctest_rb.html]
>
> Then I ran
> rdoc rdoctest.html

?? File not found: rdoctest.html

>
> Rdoc created this hyperlink:
> <a href="link:doc/files/rdoctest_rb.html">label</a>

IIRC, the link URL is relative to the --op dir. Since you are using the
default --op dir, which is doc/, you omit that from your url:

# label[link:files/rdoctest_rb.html]

You example seems to work now.