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

  • Thread starter Martin Bernd Schmeil
  • Start date
M

Martin Bernd Schmeil

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
 
E

Eric Hodel

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.

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

$ echo "<table><tr><td>1<td>2<tr><td>3<td>4</table>" > blah.txt
$ rdoc blah.txt
[...]
$ grep -A4 documentation doc/blah.txt.html
<div id="documentation">
<p>
<table><tr><td>1<td>2<tr><td>3<td>4</table>
</p>

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

$ cat blah.rb
# <table>
# <tr><td>1<td>2
# <tr><td>3<td>4
# </table>
class X
end
 
M

Martin Bernd Schmeil

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
 
E

Eric Hodel

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.
 

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
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top