How do I use rdoc's link: hyperlinks?

T

Tim Hunter

I'm trying to include a hyperlink using the label 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?
 
J

Joel VanderWerf

Tim said:
I'm trying to include a hyperlink using the label 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 :)[/QUOTE]
 
T

Tim Hunter

Joel said:
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>
 
J

Joel VanderWerf

Tim said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,160
Messages
2,570,889
Members
47,420
Latest member
ZitaVos505

Latest Threads

Top