# RDoc plain text docs with command to create an HTML table?

**URL:** <https://www.ruby-forum.com/t/rdoc-plain-text-docs-with-command-to-create-an-html-table/158943>\
**Category:** Ruby\
**Created:** [January 29, 2009, 5:13pm UTC](https://www.ruby-forum.com/t/rdoc-plain-text-docs-with-command-to-create-an-html-table/158943 "2009-01-29T17:13:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![msojka](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b5a626/32.png) [@msojka](https://www.ruby-forum.com/u/msojka)\
**Post date:** [January 29, 2009, 5:13pm UTC](https://www.ruby-forum.com/t/rdoc-plain-text-docs-with-command-to-create-an-html-table/158943/1 "2009-01-29T17:13:38Z")

</div>

Hi all,

for quite some time I’m trying to get RDoc to display an HTML table  
populated with data provided by a ruby method without success. I have  
been upgrading RDoc to 2.3.0.

The doc file is a plain text file (.rb), that should describe some  
concepts (a la rails guides).

While I played around with using '#'or ‘=begin rdoc’ I neither find a  
way to get my method that provides the data evaluated nor an HTML table  
displayed. Is this possible at all?

Thanks in advance for any hints / references.

- Bernd

---

<div class="post-metadata">

**Author:** ![msojka](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b5a626/32.png) [@msojka](https://www.ruby-forum.com/u/msojka)\
**Post date:** [January 30, 2009, 4:32am UTC](https://www.ruby-forum.com/t/rdoc-plain-text-docs-with-command-to-create-an-html-table/158943/2 "2009-01-30T04:32:41Z")

</div>

On Jan 29, 2009, at 08:11 AM, Martin Bernd S. wrote:

> way to get my method that provides the data evaluated nor an HTML  
> table  
> displayed. Is this possible at all?
> 
> Thanks in advance for any hints / references.

For a text file, a raw table is included straight up:

$ echo “

| 1 | 2 |
| 3 | 4 |

” \> blah.txt  
$ rdoc blah.txt  
[…]  
$ grep -A4 documentation doc/blah.txt.html 

| 1 | 2 |
| 3 | 4 |

For a .rb file, this should do what you want:

$ cat blah.rb

# 

# 

| 1 | 2
# 
 |
| 3 | 4
# 
 |

class X  
end

---

<div class="post-metadata">

**Author:** ![msojka](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b5a626/32.png) [@msojka](https://www.ruby-forum.com/u/msojka)\
**Post date:** [January 30, 2009, 1:02pm UTC](https://www.ruby-forum.com/t/rdoc-plain-text-docs-with-command-to-create-an-html-table/158943/3 "2009-01-30T13:02:34Z")

</div>

Hi Eric,

thanks a lot for your answer. Unfortunatly this still does not work for  
me. I building the docs with rake doc:reapp, but the HTML is escaped.

The other thing that I can’t get to work is to call a method from within  
the comment, that creates the data. Something like

# bla bla bla…

# 

# DataDictionary.describe(‘campaigns’)

# 

I’ll check later if the thing is working if I don’t use rake

Thanks again, have a nice weekend! - Bernd

---

<div class="post-metadata">

**Author:** ![msojka](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/b5a626/32.png) [@msojka](https://www.ruby-forum.com/u/msojka)\
**Post date:** [January 30, 2009, 5:49pm UTC](https://www.ruby-forum.com/t/rdoc-plain-text-docs-with-command-to-create-an-html-table/158943/4 "2009-01-30T17:49:46Z")

</div>

On Jan 30, 2009, at 03:59 AM, Martin Bernd S. wrote:

> thanks a lot for your answer. Unfortunatly this still does not work  
> for  
> me. I building the docs with rake doc:reapp, but the HTML is escaped.

Then don’t escape it.

> The other thing that I can’t get to work is to call a method from  
> within  
> the comment, that creates the data. Something like
> 
> # bla bla bla…
> 
> # 
> 
> # DataDictionary.describe(‘campaigns’)

This will never work. RDoc doesn’t run code from comments and never  
will.
