[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Need for a rdoc wizard



On Wed, Jul 31, 2013 at 11:17:45PM +0000, Marc Dequènes (Duck) wrote:
> Coin,

Coin!

> I'm trying a fix webgen0.5's main doc page but i've got a problem with links.

> It seems rdoc allowed raw HTML in the past, but it is not possible
> with a recent version. So i fixed a link in a new patch in commit
> b6019da but the generated result does not generate a proper URL and
> i can't figure out why (except if a rdoc bug).

> The rdoc markup is : {Webgen module}[rdoc-ref:Webgen]
> The broken resulting link is : <a href="../../Webgen.html">Webgen module</a>
>   (which can be seen here: http://doc.duckcorp.org/cgi-bin/dwww/usr/share/doc/webgen0.5-doc/rdoc/index.html?type=html)
> The expected link is: <a href="Webgen.html">Webgen module</a>

> Any idea?

I am far from being a rdoc wizard, but I had a brief look at this
problem. I think it is a bug/feature of rdoc.

I could reproduce the problem with rdoc1.8/rdoc1.9.1/rdoc2.0. When using
a different main page from the default one, it uses the path of this
main page to create relative context paths, like rdoc-refs
(maybe a problem in the formatter method in rdoc/generator/markup.rb.

Using an other main page in a different level, e.g. in lib/ instead of
lib/webgen (your case uses lib/webgen/website.rb) results in the broken
link <a href="../Webgen.html">Webgen module</a>.

A workaround is to create a dummy page foo.rb in the root directory of
the package, with the first lines of lib/webgen/website.rb (those lines
that are supposed to be used for the main page, together with your patch
to use rdoc-ref) and use it as the main page:

  rdoc -t 'Webgen API' -f darkfish -m foo.rb -o build-doc/rdoc lib foo.rb

What do you think?

Cheers,

Cédric

Attachment: signature.asc
Description: Digital signature


Reply to: