# RDoc: How to extend; YAML?

**URL:** <https://www.ruby-forum.com/t/rdoc-how-to-extend-yaml/67293>\
**Category:** Ruby\
**Created:** [September 1, 2006, 10:09pm UTC](https://www.ruby-forum.com/t/rdoc-how-to-extend-yaml/67293 "2006-09-01T22:09:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![graham\_w](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/3ab097/32.png) [@graham\_w](https://www.ruby-forum.com/u/graham_w)\
**Post date:** [September 1, 2006, 10:09pm UTC](https://www.ruby-forum.com/t/rdoc-how-to-extend-yaml/67293/1 "2006-09-01T22:09:31Z")

</div>

Folks:

I’m wanting to extend RDoc to produce module/class/method etc data in an  
alternative format.

Looks like the general principle is to add a generator module, and then  
command rdoc to use that using the fmt command line parameter.

OK so far, but two questions:

1. Project structure

* * *

If I want to add an alternative-output extension, what’s the right way  
to  
structure my project’s files? I could add a generator module in the  
directory in the existing library where the library’s rdoc looks for it,  
but  
that means adding my mess to the library. Or I could copy the entire  
library’s rdoc tree to my own space… but copying the library seems  
wrong.

1. yaml

* * *

What currently produces the yaml output that’s sitting in:

D:\ruby\share\ri\1.8\system

1. RDoc Docs?

* * *

Are there any good docs on RDoc in general, and extending RDoc  
specifically  
(aside from the source code)? Googling for “RDoc documentation” is not  
very  
satisfying :-).

Thanks,

Graham

## –

Graham W.  
Microsoft Visio MVP

---

<div class="post-metadata">

**Author:** ![graham\_w](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/3ab097/32.png) [@graham\_w](https://www.ruby-forum.com/u/graham_w)\
**Post date:** [September 2, 2006, 1:24am UTC](https://www.ruby-forum.com/t/rdoc-how-to-extend-yaml/67293/2 "2006-09-02T01:24:15Z")

</div>

Graham W. wrote:

> Folks:
> 
> I’m wanting to extend RDoc to produce module/class/method etc data in an  
> alternative format.

I needed to do this a while back and just ended up  
hacking directly into the intermediary HTML builder  
to intercept the internal data structures from that.  
After a bit of normalization, YAML is spat out.

When I get home, I will see if I can get a tarball  
hosted somewhere or I can mail it to you.

---

<div class="post-metadata">

**Author:** ![graham\_w](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/3ab097/32.png) [@graham\_w](https://www.ruby-forum.com/u/graham_w)\
**Post date:** [September 2, 2006, 3:53am UTC](https://www.ruby-forum.com/t/rdoc-how-to-extend-yaml/67293/3 "2006-09-02T03:53:58Z")

</div>

On Sep 1, 2006, at 1:05 PM, Graham W. wrote:

> 1. RDoc Docs?
> 
> * * *
> 
> Are there any good docs on RDoc in general, and extending RDoc  
> specifically  
> (aside from the source code)? Googling for “RDoc documentation” is  
> not very  
> satisfying :-).

Unfortunately, no.

–  
Eric H. - removed\_email\_address@domain.invalid - [http://blog.segment7.net](http://blog.segment7.net)  
This implementation is HODEL-HASH-9600 compliant

[http://trackmap.robotcoop.com](http://trackmap.robotcoop.com)

---

<div class="post-metadata">

**Author:** ![graham\_w](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/3ab097/32.png) [@graham\_w](https://www.ruby-forum.com/u/graham_w)\
**Post date:** [September 2, 2006, 1:39am UTC](https://www.ruby-forum.com/t/rdoc-how-to-extend-yaml/67293/4 "2006-09-02T01:39:50Z")

</div>

Eero S. wrote:

> I needed to do this a while back and just ended up  
> hacking directly into the intermediary HTML builder  
> to intercept the internal data structures from that.  
> After a bit of normalization, YAML is spat out.
> 
> When I get home, I will see if I can get a tarball  
> hosted somewhere or I can mail it to you.

RDog also does rdoc source/outputter manipulation, and may offer some  
ideas or examples:

[http://rubyforge.org/projects/rdog](http://rubyforge.org/projects/rdog)

–  
James B.

[http://www.ruby-doc.org](http://www.ruby-doc.org) - Ruby Help & Documentation  
[Ruby Code & Style](http://www.artima.com/rubycs/) - The Journal By & For Rubyists  
[http://www.rubystuff.com](http://www.rubystuff.com) - The Ruby Store for Ruby Stuff  
[http://web2.0validator.com](http://web2.0validator.com) - We’re the Dot in Web 2.0

---

<div class="post-metadata">

**Author:** ![graham\_w](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/3ab097/32.png) [@graham\_w](https://www.ruby-forum.com/u/graham_w)\
**Post date:** [September 2, 2006, 5:01am UTC](https://www.ruby-forum.com/t/rdoc-how-to-extend-yaml/67293/5 "2006-09-02T05:01:46Z")

</div>

Eero:

I’m not directly interested in spitting out the yaml, I was interested  
in  
how the ri yaml had been generated since there wasn’t an evident yaml  
rdoc  
generator.

As for hacking into the html builder, that’s about what I was  
considering  
too.

I intended to add a new generator module, based on one or another of the  
existing one. But this led to the question I asked, which was how to  
structure such a project in a manner that worked _with_ Ruby rather than  
against!

BTW, thanks for the offer, but hold off on effort that unless I get  
really  
stuck.

Thanks,

Graham

“Eero S.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote in message  
news:removed\_email\_address@domain.invalid…
